');--md-admonition-icon--abstract:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--info:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--tip:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--success:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--question:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--warning:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--failure:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--danger:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--bug:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--example:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--quote:url('data:image/svg+xml;charset=utf-8,');}
Git Quick Reference Guide
Create Directory (Local System)
Purpose | Command |
Create a New Directory inside Home Directory | cd -/directory name |
Create a New Git Repository Add a single file or add all files in a Directory | git init |
git add or git add --all | git add <file_name> or git add --all |
Clone into a remote repository | git clone <link> |
Commands to Check Status
Purpose | Command |
To show files that have changed | git status |
Show difference in changed files | git diff |
Show the log files | git log |
Commands Dealing With Branches
Purpose | Command |
Show the current branch that you are in | git branch <branch name> |
Create a new branch and switch to that | git checkout b <branchname> |
Switch to an existing branch | git checkout <branchname> |
Delete and existing branch | git checkout d <branchname> |
Commands To Revert Changes
Purpose | Command |
Revert a particular commit by its ID | git revert <commit id> |
Revert all commits | git revert hard |
Revert the last change | git revert ^HEAD |
Fix the last commit | git commit amend |
Commands To Publish Your Changes
Purpose | Command |
Commit your local changes | git commit -m "Update" |
Commit your local changes (Edit Separate Message) | git commit -a |
Push changes to your repo | git push u origin master/branch name |
For other developers | git format patch origin |
For any help | git --help |
Read More