@@ -20,78 +20,78 @@ http://git-scm.com
20
20
Configure user information for all local repositories
21
21
22
22
``` $ git config --global user.name "[name]" ```
23
- Set the name you want attached to your commit transactions
23
+ Sets the name you want attached to your commit transactions
24
24
25
25
``` $ git config --global user.email "[email address]" ```
26
- Set the email you want attached to your commit transactions
26
+ Sets the email you want attached to your commit transactions
27
27
28
28
``` $ git config --global color.ui auto ```
29
- Enable helpful colorization of command line output
29
+ Enables helpful colorization of command line output
30
30
31
31
32
32
## Create repositories
33
- Start a new repository or obtain one from an existing URL
33
+ Starts a new repository or obtain one from an existing URL
34
34
35
35
``` $ git init [project-name] ```
36
- Create a new local repository with the specified name
36
+ Creates a new local repository with the specified name
37
37
38
38
``` $ git clone [url] ```
39
- Download a project and its entire version history
39
+ Downloads a project and its entire version history
40
40
41
41
## Make changes
42
- Review edits and craft a commit transaction
42
+ Reviews edits and craft a commit transaction
43
43
44
44
``` $ git status ```
45
- List all new or modified files to be committed
45
+ Lists all new or modified files to be committed
46
46
47
47
``` $ git diff ```
48
- Show file differences not yet staged
48
+ Shows file differences not yet staged
49
49
50
50
``` $ git add [file] ```
51
- Snapshot the file in preparation for versioning
51
+ Snapshots the file in preparation for versioning
52
52
53
53
``` $ git diff --staged ```
54
- Show file differences between staging and the last file version
54
+ Shows file differences between staging and the last file version
55
55
56
56
``` $ git reset [file] ```
57
- Unstage the file, but preserve its contents
57
+ Unstages the file, but preserve its contents
58
58
59
59
``` $ git commit -m"[descriptive message]" ```
60
- Record file snapshots permanently in version history
60
+ Records file snapshots permanently in version history
61
61
62
62
## Group changes
63
- Name a series of commits and combine completed efforts
63
+ Names a series of commits and combine completed efforts
64
64
65
65
``` $ git branch ```
66
- List all local branches in the current repository
66
+ Lists all local branches in the current repository
67
67
68
68
``` $ git branch [branch-name] ```
69
- Create a new branch
69
+ Creates a new branch
70
70
71
71
``` $ git checkout [branch-name] ```
72
- Switch to the specified branch and update working directory
72
+ Switches to the specified branch and update working directory
73
73
74
74
``` $ git merge [branch-name] ```
75
- Combine the specified branch’s history into the current branch
75
+ Combines the specified branch’s history into the current branch
76
76
77
77
``` $ git branch -d [branch-name] ```
78
- Delete the specified branch
78
+ Deletes the specified branch
79
79
80
80
81
81
## Refactor filenames
82
- Relocate and remove versioned files
82
+ Relocates and remove versioned files
83
83
84
84
``` $ git rm [file] ```
85
- Delete the file from the working directory and stage the deletion
85
+ Deletes the file from the working directory and stage the deletion
86
86
87
87
``` $ git rm --cached [file] ```
88
- Remove from version control but preserve the file locally
88
+ Removes from version control but preserve the file locally
89
89
90
90
``` $ git mv [file-original] [file-renamed] ```
91
- Change the filename and prepare it for commit
91
+ Changes the filename and prepare it for commit
92
92
93
93
## Supress tracking
94
- Exclude temporary files and paths
94
+ Excludes temporary files and paths
95
95
96
96
```
97
97
*.log
@@ -101,61 +101,61 @@ temp-*
101
101
A text file named ` .gitignore ` suppresses accidental versioning of files and paths matching the specified patterns
102
102
103
103
``` $ git ls-files --other --ignored --exclude-standard ```
104
- List all ignored files in this project
104
+ Lists all ignored files in this project
105
105
106
106
## Save fragments
107
107
Shelve and restore incomplete changes
108
108
109
109
``` $ git stash ```
110
- Temporarily store all modified tracked files
110
+ Temporarily stores all modified tracked files
111
111
112
112
``` $ git stash pop ```
113
- Restore the most recently stashed files
113
+ Restores the most recently stashed files
114
114
115
115
``` $ git stash list ```
116
- List all stashed changesets
116
+ Lists all stashed changesets
117
117
118
118
``` $ git stash drop ```
119
- Discard the most recently stashed changeset
119
+ Discards the most recently stashed changeset
120
120
121
121
## Review history
122
- Browse and inspect the evolution of project files
122
+ Browses and inspect the evolution of project files
123
123
124
124
``` $ git log ```
125
- List version history for the current branch
125
+ Lists version history for the current branch
126
126
127
127
``` $ git log --follow [file] ```
128
- List version history for a file, including renames
128
+ Lists version history for a file, including renames
129
129
130
130
``` $ git diff [first-branch]...[second-branch] ```
131
- Show content differences between two branches
131
+ Shows content differences between two branches
132
132
133
133
``` $ git show [commit] ```
134
- Output metadata and content changes of the specified commit
134
+ Outputs metadata and content changes of the specified commit
135
135
136
136
## Redo commits
137
- Erase mistakes and craft replacement history
137
+ Erases mistakes and craft replacement history
138
138
139
139
``` $ git reset [commit] ```
140
- Undo all commits after [ commit] , preserving changes locally
140
+ Undoes all commits after [ commit] , preserving changes locally
141
141
142
142
``` $ git reset --hard [commit] ```
143
- Discard all history and changes back to the specified commit
143
+ Discards all history and changes back to the specified commit
144
144
145
145
## Synchronize changes
146
- Register a repository bookmark and exchange version history
146
+ Registers a repository bookmark and exchange version history
147
147
148
148
``` $ git fetch [bookmark] ```
149
- Download all history from the repository bookmark
149
+ Downloads all history from the repository bookmark
150
150
151
151
``` $ git merge [bookmark]/[branch] ```
152
- Combine bookmark’s branch into into current local branch
152
+ Combines bookmark’s branch into into current local branch
153
153
154
154
``` $ git push [alias] [branch] ```
155
- Upload all local branch commits to GitHub
155
+ Uploads all local branch commits to GitHub
156
156
157
157
``` $ git pull ```
158
- Synchronize bookmark history and incorporate current branch changes
158
+ Synchronizes bookmark history and incorporate current branch changes
159
159
160
160
---
161
161
0 commit comments