@@ -19,75 +19,75 @@ http://git-scm.com
1919## Configure tooling
2020Configure user information for all local repositories
2121
22- ``` git config --global user.name "[name]" ```
22+ ``` $ git config --global user.name "[name]"```
2323Set the name you want attached to your commit transactions
2424
25- ``` git config --global user.email "[email address]" ```
25+ ``` $ git config --global user.email "[email address]"```
2626Set the email you want attached to your commit transactions
2727
28- ``` git config --global color.ui auto ```
28+ ``` $ git config --global color.ui auto```
2929Enable helpful colorization of command line output
3030
3131
3232## Create repositories
3333Start a new repository or obtain one from an existing URL
3434
35- ``` git init [project-name] ```
35+ ``` $ git init [project-name]```
3636Create a new local repository with the specified name
3737
38- ``` git clone [url] ```
38+ ``` $ git clone [url]```
3939Download a project and its entire version history
4040
4141## Make changes
4242Review edits and craft a commit transaction
4343
44- ``` git status ```
44+ ``` $ git status```
4545List all new or modified files to be committed
4646
47- ``` git diff ```
47+ ``` $ git diff```
4848Show file differences not yet staged
4949
50- ``` git add [file] ```
50+ ``` $ git add [file]```
5151Snapshot the file in preparation for versioning
5252
53- ``` git diff --staged ```
53+ ``` $ git diff --staged```
5454Show file differences between staging and the last file version
5555
56- ``` git reset [file] ```
56+ ``` $ git reset [file]```
5757Unstage the file, but preserve its contents
5858
59- ``` git commit -m"[descriptive message]" ```
59+ ``` $ git commit -m"[descriptive message]"```
6060Record file snapshots permanently in version history
6161
6262## Group changes
6363Name a series of commits and combine completed efforts
6464
65- ``` git branch ```
65+ ``` $ git branch```
6666List all local branches in the current repository
6767
68- ``` git branch [branch-name] ```
68+ ``` $ git branch [branch-name]```
6969Create a new branch
7070
71- ``` git checkout [branch-name] ```
71+ ``` $ git checkout [branch-name]```
7272Switch to the specified branch and update working directory
7373
74- ``` git merge [branch-name] ```
74+ ``` $ git merge [branch-name]```
7575Combine the specified branch’s history into the current branch
7676
77- ``` git branch -d [branch-name] ```
77+ ``` $ git branch -d [branch-name]```
7878Delete the specified branch
7979
8080
8181## Refactor filenames
8282Relocate and remove versioned files
8383
84- ``` git rm [file] ```
84+ ``` $ git rm [file]```
8585Delete the file from the working directory and stage the deletion
8686
87- ``` git rm --cached [file] ```
87+ ``` $ git rm --cached [file]```
8888Remove from version control but preserve the file locally
8989
90- ``` git mv [file-original] [file-renamed] ```
90+ ``` $ git mv [file-original] [file-renamed]```
9191Change the filename and prepare it for commit
9292
9393## Supress tracking
@@ -100,61 +100,61 @@ temp-*
100100```
101101A text file named ` .gitignore ` suppresses accidental versioning of files and paths matching the specified patterns
102102
103- ``` git ls-files --other --ignored --exclude-standard ```
103+ ``` $ git ls-files --other --ignored --exclude-standard```
104104List all ignored files in this project
105105
106106## Save fragments
107107Shelve and restore incomplete changes
108108
109- ``` git stash ```
109+ ``` $ git stash```
110110Temporarily store all modified tracked files
111111
112- ``` git stash pop ```
112+ ``` $ git stash pop```
113113Restore the most recently stashed files
114114
115- ``` git stash list ```
115+ ``` $ git stash list```
116116List all stashed changesets
117117
118- ``` git stash drop ```
118+ ``` $ git stash drop```
119119Discard the most recently stashed changeset
120120
121121## Review history
122122Browse and inspect the evolution of project files
123123
124- ``` git log ```
124+ ``` $ git log```
125125List version history for the current branch
126126
127- ``` git log --follow [file] ```
127+ ``` $ git log --follow [file]```
128128List version history for a file, including renames
129129
130- ``` git diff [first-branch]...[second-branch] ```
130+ ``` $ git diff [first-branch]...[second-branch]```
131131Show content differences between two branches
132132
133- ``` git show [commit] ```
133+ ``` $ git show [commit]```
134134Output metadata and content changes of the specified commit
135135
136136## Redo commits
137137Erase mistakes and craft replacement history
138138
139- ``` git reset [commit] ```
139+ ``` $ git reset [commit]```
140140Undo all commits after [ commit] , preserving changes locally
141141
142- ``` git reset --hard [commit] ```
142+ ``` $ git reset --hard [commit]```
143143Discard all history and changes back to the specified commit
144144
145145## Synchronize changes
146146Register a repository bookmark and exchange version history
147147
148- ``` git fetch [bookmark] ```
148+ ``` $ git fetch [bookmark]```
149149Download all history from the repository bookmark
150150
151- ``` git merge [bookmark]/[branch] ```
151+ ``` $ git merge [bookmark]/[branch]```
152152Combine bookmark’s branch into into current local branch
153153
154- ``` git push [alias] [branch] ```
154+ ``` $ git push [alias] [branch]```
155155Upload all local branch commits to GitHub
156156
157- ``` git pull ```
157+ ``` $ git pull```
158158Synchronize bookmark history and incorporate current branch changes
159159
160160---
0 commit comments