File tree Expand file tree Collapse file tree 4 files changed +29
-0
lines changed Expand file tree Collapse file tree 4 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 266
266
</ p >
267
267
268
268
< h4 >
269
+ < a name ="diff-cached "> </ a >
269
270
git diff --cached
270
271
< small > show diff of staged changes</ small >
271
272
</ h4 >
313
314
</ pre >
314
315
315
316
< h4 >
317
+ < a name ="diff-head "> </ a >
316
318
git diff HEAD
317
319
< small > show diff of all staged or unstaged changes</ small >
318
320
</ h4 >
372
374
</ pre >
373
375
374
376
< h4 >
377
+ < a name ="diff-stat "> </ a >
375
378
git diff --stat
376
379
< small > show summary of changes instead of a full diff</ small >
377
380
</ h4 >
536
539
is easier for them to see what you are doing and why.</ p >
537
540
538
541
< h4 >
542
+ < a name ="commit-a "> </ a >
539
543
git commit -a
540
544
< small > automatically stage all tracked, modified files before the commit</ small >
541
545
</ h4 >
611
615
</ p >
612
616
613
617
< h4 >
618
+ < a name ="reset-head "> </ a >
614
619
git reset HEAD
615
620
< small > unstage files from index and reset pointer to HEAD</ small >
616
621
</ h4 >
690
695
< code > --soft</ code > and < code > --hard</ code > .</ p >
691
696
692
697
< h4 >
698
+ < a name ="reset-soft "> </ a >
693
699
git reset --soft
694
700
< small > moves HEAD to specified commit reference, index and staging are untouched</ small >
695
701
</ h4 >
720
726
before you roll in the file changes into the same commit.</ p >
721
727
722
728
< h4 >
729
+ < a name ="reset-hard "> </ a >
723
730
git reset --hard
724
731
< small > unstage files AND undo any changes in the working directory since last commit</ small >
725
732
</ h4 >
869
876
</ pre >
870
877
871
878
< h4 >
879
+ < a name ="stash-list "> </ a >
872
880
git stash list
873
881
< small > view stashes currently on the stack</ small >
874
882
</ h4 >
902
910
</ pre >
903
911
904
912
< h4 >
913
+ < a name ="stash-apply "> </ a >
905
914
git stash apply
906
915
< small > grab the item from the stash list and apply to current working directory</ small >
907
916
</ h4 >
935
944
</ p >
936
945
937
946
< h4 >
947
+ < a name ="stash-drop "> </ a >
938
948
git stash drop
939
949
< small > remove an item from the stash list</ small >
940
950
</ h4 >
Original file line number Diff line number Diff line change 65
65
</ p >
66
66
67
67
< h4 >
68
+ < a name ="branch-list "> </ a >
68
69
git branch
69
70
< small > list your available branches</ small >
70
71
</ h4 >
89
90
</ p >
90
91
91
92
< h4 >
93
+ < a name ="branch-create "> </ a >
92
94
git branch (branchname)
93
95
< small > create a new branch</ small >
94
96
</ h4 >
146
148
</ pre >
147
149
148
150
< h4 >
151
+ < a name ="branch-last-commit "> </ a >
149
152
git branch -v
150
153
< small > see the last commit on each branch</ small >
151
154
</ h4 >
161
164
</ pre >
162
165
163
166
< h4 >
167
+ < a name ="branch-create-switch "> </ a >
164
168
git checkout -b (branchname)
165
169
< small > create and immediately switch to a branch</ small >
166
170
</ h4 >
212
216
aside and then come back to.</ p >
213
217
214
218
< h4 >
219
+ < a name ="branch-delete "> </ a >
215
220
git branch -d (branchname)
216
221
< small > delete a branch</ small >
217
222
</ h4 >
231
236
</ pre >
232
237
233
238
< h4 >
239
+ < a name ="branch-delete-remote "> </ a >
234
240
git push (remote-name) :(branchname)
235
241
< small > delete a remote branch</ small >
236
242
</ h4 >
310
316
</ pre >
311
317
312
318
< h4 >
319
+ < a name ="merge-complex "> </ a >
313
320
more complex merges
314
321
</ h4 >
315
322
411
418
that was done in the other branch. Pretty cool.</ p >
412
419
413
420
< h4 >
421
+ < a name ="merge-conflicts "> </ a >
414
422
merge conflicts
415
423
</ h4 >
416
424
Original file line number Diff line number Diff line change 48
48
</ p >
49
49
50
50
< h4 >
51
+ < a name ="log-author "> </ a >
51
52
git log --author
52
53
< small > look for only commits from a specific author</ small >
53
54
</ h4 >
72
73
</ pre >
73
74
74
75
< h4 >
76
+ < a name ="log-date "> </ a >
75
77
git log --since --before
76
78
< small > filter commits by date committed</ small >
77
79
</ h4 >
99
101
</ pre >
100
102
101
103
< h4 >
104
+ < a name ="log-grep "> </ a >
102
105
git log --grep
103
106
< small > filter commits by commit message</ small >
104
107
</ h4 >
176
179
</ pre >
177
180
178
181
< h4 >
182
+ < a name ="log-s "> </ a >
179
183
git log -S
180
184
< small > filter by introduced diff</ small >
181
185
</ h4 >
211
215
</ pre >
212
216
213
217
< h4 >
218
+ < a name ="log-patch "> </ a >
214
219
git log -p
215
220
< small > show patch introduced at each commit</ small >
216
221
</ h4 >
271
276
of commits before merging them or releasing something.</ p >
272
277
273
278
< h4 >
279
+ < a name ="log-stat "> </ a >
274
280
git log --stat
275
281
< small > show diffstat of changes introduced at each commit</ small >
276
282
</ h4 >
Original file line number Diff line number Diff line change 65
65
you care about.</ p >
66
66
67
67
< h4 >
68
+ < a name ="remote-list "> </ a >
68
69
git remote
69
70
< small > list your remote aliases</ small >
70
71
</ h4 >
89
90
protocols for reads and writes.</ p >
90
91
91
92
< h4 >
93
+ < a name ="remote-add "> </ a >
92
94
git remote add
93
95
< small > add a new remote repository of your project</ small >
94
96
</ h4 >
122
124
</ p >
123
125
124
126
< h4 >
127
+ < a name ="remote-remove "> </ a >
125
128
git remote rm
126
129
< small > removing an existing remote alias</ small >
127
130
</ h4 >
147
150
</ pre >
148
151
149
152
< h4 >
153
+ < a name ="remote-rename "> </ a >
150
154
git remote rename [old-alias] [new-alias]
151
155
< small > rename remote aliases</ small >
152
156
</ h4 >
174
178
</ p >
175
179
176
180
< h4 >
181
+ < a name ="remote-update "> </ a >
177
182
git remote set-url
178
183
< small > update an existing remote URL</ small >
179
184
</ h4 >
You can’t perform that action at this time.
0 commit comments