You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| git init |`git init <directory>`| Create an empty git repository in the specified directory. |
74
-
| git clone |`git clone <repo>`| Clone repository located at <repo> onto local machine. |
74
+
| git clone |`git clone <repo>`| Clone repository located at \<repo> onto local machine. |
75
75
| git config |`git config user.name`| Define author name to be used for all commits in current repository `system`, `global`, `local` flag to set config options. |
76
-
| git add |`git add <directory>`| Stage all changes in <directory> for the next commit. We can also add <files> and <.> for everything. |
77
-
| git commit -m |`git commit -m "<message>"`| Commit the staged snapshot, use <message> to detail what is being committed. |
76
+
| git add |`git add <directory>`| Stage all changes in \<directory> for the next commit. We can also add \<files> and \<.> for everything. |
77
+
| git commit -m |`git commit -m "<message>"`| Commit the staged snapshot, use \<message> to detail what is being committed. |
78
78
| git status |`git status`| List files that are staged, unstaged and untracked. |
79
79
| git log |`git log`| Display all commit history using the default format. There are additional options with this command. |
80
80
| git diff |`git diff`| Show unstaged changes between your index and working directory. |
@@ -83,34 +83,34 @@ I have taken these from [atlassian](https://www.atlassian.com/git/tutorials/atla
| git revert |`git revert <commit>`| Create a new commit that undoes all of the changes made in <commit> then apply it to the current branch. |
87
-
| git reset |`git reset <file>`| Remove <file> from the staging area, but leave the working directory unchanged. This unstaged a file without overwriting any changes. |
86
+
| git revert |`git revert <commit>`| Create a new commit that undoes all of the changes made in \<commit> then apply it to the current branch. |
87
+
| git reset |`git reset <file>`| Remove \<file> from the staging area, but leave the working directory unchanged. This unstaged a file without overwriting any changes. |
88
88
| git clean |`git clean -n`| Shows which files would be removed from the working directory. Use `-f` in place of `-n` to execute the clean. |
| git commit |`git commit --amend`| Replace the last commit with the staged changes and the last commit combined. Use with nothing staged to edit the last commit’s message. |
95
-
| git rebase |`git rebase <base>`| Rebase the current branch onto <base>. <base> can be a commit ID, branch name, a tag, or a relative reference to HEAD. |
95
+
| git rebase |`git rebase <base>`| Rebase the current branch onto \<base>. \<base> can be a commit ID, branch name, a tag, or a relative reference to HEAD. |
96
96
| git reflog |`git reflog`| Show a log of changes to the local repository’s HEAD. Add --relative-date flag to show date info or --all to show all refs. |
| git remote add |`git remote add <name> <url>`| Create a new connection to a remote repo. After adding a remote, you can use <name> as a shortcut for <url> in other commands. |
111
-
| git fetch |`git fetch <remote> <branch>`| Fetches a specific <branch>, from the repo. Leave off <branch> to fetch all remote refs. |
110
+
| git remote add |`git remote add <name> <url>`| Create a new connection to a remote repo. After adding a remote, you can use \<name> as a shortcut for \<url> in other commands. |
111
+
| git fetch |`git fetch <remote> <branch>`| Fetches a specific \<branch>, from the repo. Leave off \<branch> to fetch all remote refs. |
112
112
| git pull |`git pull <remote>`| Fetch the specified remote’s copy of current branch and immediately merge it into the local copy. |
113
-
| git push |`git push <remote> <branch>`| Push the branch to <remote>, along with necessary commits and objects. Creates named branch in the remote repo if it doesn’t exist. |
113
+
| git push |`git push <remote> <branch>`| Push the branch to \<remote>, along with necessary commits and objects. Creates named branch in the remote repo if it doesn’t exist. |
114
114
115
115
### Git Diff
116
116
@@ -123,40 +123,40 @@ I have taken these from [atlassian](https://www.atlassian.com/git/tutorials/atla
| git config --global user.name <name> |`git config --global user.name <name>`| Define the author name to be used for all commits by the current user. |
127
-
| git config --global user.email <email> |`git config --global user.email <email>`| Define author email to be used for all commits by the current user. |
128
-
| git config --global alias <alias-name> <git-command> |`git config --global alias <alias-name> <git-command>`| Create shortcut for a git command . |
129
-
| git config --system core.editor <editor> |`git config --system core.editor <editor>`| Set the text editor to be used by commands for all users on the machine. <editor> arg should be the comamnd that launches the desired editor. |
126
+
| git config --global user.name \<name> |`git config --global user.name <name>`| Define the author name to be used for all commits by the current user. |
127
+
| git config --global user.email \<email> |`git config --global user.email <email>`| Define author email to be used for all commits by the current user. |
128
+
| git config --global alias \<alias-name> \<git-command> |`git config --global alias <alias-name> <git-command>`| Create shortcut for a git command . |
129
+
| git config --system core.editor \<editor> |`git config --system core.editor <editor>`| Set the text editor to be used by commands for all users on the machine. \<editor> arg should be the comamnd that launches the desired editor. |
130
130
| git config --global --edit |`git config --global --edit `| Open the global configuration file in a text editor for manual editing. |
| git rebase -i <base> |`git rebase -i <base>`| Interactively rebase current branch onto <base>. Launches editor to enter commands for how each commit will be transferred to the new base. |
136
+
| git rebase -i \<base> |`git rebase -i <base>`| Interactively rebase current branch onto \<base>. Launches editor to enter commands for how each commit will be transferred to the new base. |
| git pull --rebase <remote> |`git pull --rebase <remote>`| Fetch the remote’s copy of current branch and rebases it into the local copy. Uses git rebase instead of the merge to integrate the branches. |
142
+
| git pull --rebase \<remote> |`git pull --rebase <remote>`| Fetch the remote’s copy of current branch and rebases it into the local copy. Uses git rebase instead of the merge to integrate the branches. |
| git reset |`git reset `| Reset the staging area to match the most recent commit but leave the working directory unchanged. |
149
149
| git reset --hard |`git reset --hard`| Reset staging area and working directory to match most recent commit and overwrites all changes in the working directory |
150
-
| git reset <commit> |`git reset <commit>`| Move the current branch tip backwards to <commit>, reset the staging area to match, but leave the working directory alone |
151
-
| git reset --hard <commit> |`git reset --hard <commit>`| Same as previous, but resets both the staging area & working directory to match. Deletes uncommitted changes, and all commits after <commit>. |
150
+
| git reset \<commit> |`git reset <commit>`| Move the current branch tip backwards to \<commit>, reset the staging area to match, but leave the working directory alone |
151
+
| git reset --hard \<commit> |`git reset --hard <commit>`| Same as previous, but resets both the staging area & working directory to match. Deletes uncommitted changes, and all commits after \<commit>. |
| git push <remote> --force |`git push <remote> --force`| Forces the git push even if it results in a non-fast-forward merge. Do not use the --force flag unless you’re sure you know what you’re doing. |
158
-
| git push <remote> --all |`git push <remote> --all`| Push all of your local branches to the specified remote. |
159
-
| git push <remote> --tags |`git push <remote> --tags`| Tags aren’t automatically pushed when you push a branch or use the --all flag. The --tags flag sends all of your local tags to the remote repo. |
157
+
| git push \<remote> --force |`git push <remote> --force`| Forces the git push even if it results in a non-fast-forward merge. Do not use the --force flag unless you’re sure you know what you’re doing. |
158
+
| git push \<remote> --all |`git push <remote> --all`| Push all of your local branches to the specified remote. |
159
+
| git push \<remote> --tags |`git push <remote> --tags`| Tags aren’t automatically pushed when you push a branch or use the --all flag. The --tags flag sends all of your local tags to the remote repo. |
0 commit comments