Skip to content

Commit 99ef7cf

Browse files
author
jordanmccullough
committed
Add $ char in front of command line examples
1 parent 110f6cc commit 99ef7cf

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

downloads/github-git-cheat-sheet.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -19,75 +19,75 @@ http://git-scm.com
1919
## Configure tooling
2020
Configure user information for all local repositories
2121

22-
```git config --global user.name "[name]"```
22+
```$ git config --global user.name "[name]"```
2323
Set 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]"```
2626
Set the email you want attached to your commit transactions
2727

28-
```git config --global color.ui auto```
28+
```$ git config --global color.ui auto```
2929
Enable helpful colorization of command line output
3030

3131

3232
## Create repositories
3333
Start a new repository or obtain one from an existing URL
3434

35-
```git init [project-name]```
35+
```$ git init [project-name]```
3636
Create a new local repository with the specified name
3737

38-
```git clone [url]```
38+
```$ git clone [url]```
3939
Download a project and its entire version history
4040

4141
## Make changes
4242
Review edits and craft a commit transaction
4343

44-
```git status```
44+
```$ git status```
4545
List all new or modified files to be committed
4646

47-
```git diff```
47+
```$ git diff```
4848
Show file differences not yet staged
4949

50-
```git add [file]```
50+
```$ git add [file]```
5151
Snapshot the file in preparation for versioning
5252

53-
```git diff --staged```
53+
```$ git diff --staged```
5454
Show file differences between staging and the last file version
5555

56-
```git reset [file]```
56+
```$ git reset [file]```
5757
Unstage the file, but preserve its contents
5858

59-
```git commit -m"[descriptive message]"```
59+
```$ git commit -m"[descriptive message]"```
6060
Record file snapshots permanently in version history
6161

6262
## Group changes
6363
Name a series of commits and combine completed efforts
6464

65-
```git branch```
65+
```$ git branch```
6666
List all local branches in the current repository
6767

68-
```git branch [branch-name]```
68+
```$ git branch [branch-name]```
6969
Create a new branch
7070

71-
```git checkout [branch-name]```
71+
```$ git checkout [branch-name]```
7272
Switch to the specified branch and update working directory
7373

74-
```git merge [branch-name]```
74+
```$ git merge [branch-name]```
7575
Combine the specified branch’s history into the current branch
7676

77-
```git branch -d [branch-name]```
77+
```$ git branch -d [branch-name]```
7878
Delete the specified branch
7979

8080

8181
## Refactor filenames
8282
Relocate and remove versioned files
8383

84-
```git rm [file]```
84+
```$ git rm [file]```
8585
Delete the file from the working directory and stage the deletion
8686

87-
```git rm --cached [file]```
87+
```$ git rm --cached [file]```
8888
Remove from version control but preserve the file locally
8989

90-
```git mv [file-original] [file-renamed]```
90+
```$ git mv [file-original] [file-renamed]```
9191
Change the filename and prepare it for commit
9292

9393
## Supress tracking
@@ -100,61 +100,61 @@ temp-*
100100
```
101101
A 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```
104104
List all ignored files in this project
105105

106106
## Save fragments
107107
Shelve and restore incomplete changes
108108

109-
```git stash```
109+
```$ git stash```
110110
Temporarily store all modified tracked files
111111

112-
```git stash pop```
112+
```$ git stash pop```
113113
Restore the most recently stashed files
114114

115-
```git stash list```
115+
```$ git stash list```
116116
List all stashed changesets
117117

118-
```git stash drop```
118+
```$ git stash drop```
119119
Discard the most recently stashed changeset
120120

121121
## Review history
122122
Browse and inspect the evolution of project files
123123

124-
```git log```
124+
```$ git log```
125125
List version history for the current branch
126126

127-
```git log --follow [file]```
127+
```$ git log --follow [file]```
128128
List version history for a file, including renames
129129

130-
```git diff [first-branch]...[second-branch]```
130+
```$ git diff [first-branch]...[second-branch]```
131131
Show content differences between two branches
132132

133-
```git show [commit]```
133+
```$ git show [commit]```
134134
Output metadata and content changes of the specified commit
135135

136136
## Redo commits
137137
Erase mistakes and craft replacement history
138138

139-
```git reset [commit]```
139+
```$ git reset [commit]```
140140
Undo all commits after [commit], preserving changes locally
141141

142-
```git reset --hard [commit]```
142+
```$ git reset --hard [commit]```
143143
Discard all history and changes back to the specified commit
144144

145145
## Synchronize changes
146146
Register a repository bookmark and exchange version history
147147

148-
```git fetch [bookmark]```
148+
```$ git fetch [bookmark]```
149149
Download all history from the repository bookmark
150150

151-
```git merge [bookmark]/[branch]```
151+
```$ git merge [bookmark]/[branch]```
152152
Combine bookmark’s branch into into current local branch
153153

154-
```git push [alias] [branch]```
154+
```$ git push [alias] [branch]```
155155
Upload all local branch commits to GitHub
156156

157-
```git pull```
157+
```$ git pull```
158158
Synchronize bookmark history and incorporate current branch changes
159159

160160
---

0 commit comments

Comments
 (0)