forked from hschne/git-aliases
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
485 lines (478 loc) · 11.9 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
<!DOCTYPE html>
<html>
<head>
<title>git-aliases</title>
<meta charset="UTF-8">
<link href='https://fonts.googleapis.com/css?family=Roboto Mono' rel='stylesheet'>
<link href="default.css" rel="stylesheet" media="screen">
<link href="print.css" rel="stylesheet" media="print">
</head>
<body>
<header class="header">
<h1>Git Aliases Cheatsheet</h1>
<h3 class="subheader">Inspired by the Oh-My-Zsh <a
href="https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh">Git Plugin</a>.
Print or download the <a href="https://github.com/hschne/git-aliases/releases/download/1.0.0/git-aliases-1.0.0.pdf">PDF</a>.</h3>
</header>
<div class="container">
<table id="add-and-commit">
<tr>
<th colspan="2">Add & Commit</th>
</tr>
<tr>
<td>g</td>
<td>git</td>
</tr>
<tr>
<td>ga</td>
<td>git add</td>
</tr>
<tr>
<td>gaa</td>
<td>git add --all</td>
</tr>
<tr>
<td>gapa</td>
<td>git add --patch</td>
</tr>
<tr>
<td>gc</td>
<td>git commit -v</td>
</tr>
<tr>
<td>gc!</td>
<td>git commit -v --amend</td>
</tr>
<tr>
<td>gca</td>
<td>git commit -v -a</td>
</tr>
<tr>
<td>gca!</td>
<td>git commit -v -a --amend</td>
</tr>
<tr>
<td>gcan!</td>
<td>git commit -v -a --no-edit --amend</td>
</tr>
<tr>
<td>gcans!</td>
<td>git commit -v -a -s --no-edit --amend</td>
</tr>
<tr>
<td>gcam</td>
<td>git commit -a -m</td>
</tr>
<tr>
<td>gcsm</td>
<td>git commit -s -m</td>
</tr>
<tr>
<td>gcmsg</td>
<td>git commit -m</td>
</tr>
<tr>
<td>gcs</td>
<td>git commit -S</td>
</tr>
</table>
<table id="checkout-and-branch">
<tr>
<th colspan="2">Checkout & Branch</th>
</tr>
<tr>
<td>gco</td>
<td>git checkout</td>
</tr>
<tr>
<td>gcd</td>
<td>git checkout develop</td>
</tr>
<tr>
<td>gcm</td>
<td>git checkout master</td>
</tr>
<tr>
<td>gcb</td>
<td>git checkout -b</td>
</tr>
<tr>
<td>gbnm</td>
<td>git branch --no-merged</td>
</tr>
<tr>
<td>gbr</td>
<td>git branch --remote</td>
</tr>
<tr>
<td>ggsup</td>
<td>git branch --set-upstream-to=origin/$(current_branch)</td>
</tr>
</table>
<table id="logs">
<tr>
<th colspan="2">Logs</th>
</tr>
<tr>
<td>glg</td>
<td>git log --stat --max-count = 10</td>
</tr>
<tr>
<td>glgg</td>
<td>git log --graph --max-count = 10</td>
</tr>
<tr>
<td>glgga</td>
<td>git log --graph --decorate --all</td>
</tr>
<tr>
<td>glo</td>
<td>git log --oneline --decorate --color</td>
</tr>
<tr>
<td>glog</td>
<td>git log --oneline --decorate --color --graph</td>
</tr>
<tr>
<td>glp</td>
<td>git log --pretty=$1</td>
</tr>
</table>
<table id="clone-push-fetch">
<tr>
<th colspan="2">Clone, Push, Fetch, Pull and Merge</th>
</tr>
<tr>
<td>gcl</td>
<td>git clone --recursive</td>
</tr>
<tr>
<td>gp</td>
<td>git push</td>
</tr>
<tr>
<td>ggp</td>
<td>git push origin $(current_branch)</td>
</tr>
<tr>
<td>ggpush</td>
<td>git push origin $(current_branch)</td>
</tr>
<tr>
<td>gpsup</td>
<td>git push --set-upstream origin $(current_branch)</td>
</tr>
<tr>
<td>gpoat</td>
<td>git push origin --all && git push origin --tags</td>
</tr>
<tr>
<td>gf</td>
<td>git fetch</td>
</tr>
<tr>
<td>gfa</td>
<td>git fetch --all --prune</td>
</tr>
<tr>
<td>gfo</td>
<td>git fetch origin</td>
</tr>
<tr>
<td>ggl</td>
<td>git pull origin $(current_branch)</td>
</tr>
<tr>
<td>ggpull</td>
<td>git pull origin $(current_branch)</td>
</tr>
<tr>
<td>ggpur</td>
<td>git pull --rebase origin $(current_branch)</td>
</tr>
<tr>
<td>glum</td>
<td>git pull upstream master</td>
</tr>
<tr>
<td>gup</td>
<td>git pull --rebase</td>
</tr>
<tr>
<td>ggpnp</td>
<td>git pull origin $(current_branch) && git push origin $(current_branch)</td>
</tr>
<tr>
<td>gm</td>
<td>git merge</td>
</tr>
<tr>
<td>gmom</td>
<td>git merge origin/master</td>
</tr>
<tr>
<td>gmt</td>
<td>git mergetool --no-prompt</td>
</tr>
<tr>
<td>gmtvim</td>
<td>git mergetool --no-prompt --tool=vimdiff</td>
</tr>
<tr>
<td>gmum</td>
<td>git merge upstream/master</td>
</tr>
<tr>
<td>gma</td>
<td>git merge --abort</td>
</tr>
</table>
<table id="remotes">
<tr>
<th colspan="2">Remotes</th>
</tr>
<tr>
<td>gr</td>
<td>git remote</td>
</tr>
<tr>
<td>grv</td>
<td>git remote -v</td>
</tr>
<tr>
<td>grmv</td>
<td>git remote rename</td>
</tr>
<tr>
<td>grrm</td>
<td>git remote remove</td>
</tr>
<tr>
<td>grset</td>
<td>git remote set-url</td>
</tr>
<tr>
<td>grup</td>
<td>git remote update</td>
</tr>
</table>
<table id="work-in-progress">
<tr>
<th colspan="2">Work in Progress</th>
</tr>
<tr>
<td>gst</td>
<td>git status</td>
</tr>
<tr>
<td>gss</td>
<td>git status -s</td>
</tr>
<tr>
<td>gsta</td>
<td>git stash save</td>
</tr>
<tr>
<td>gstaa</td>
<td>git stash apply</td>
</tr>
<tr>
<td>gstd</td>
<td>git stash drop</td>
</tr>
<tr>
<td>gstl</td>
<td>git stash list</td>
</tr>
<tr>
<td>grh</td>
<td>git reset HEAD</td>
</tr>
<tr>
<td>grhh</td>
<td>git reset HEAD --hard</td>
</tr>
<tr>
<td>gclean</td>
<td>git clean -fd</td>
</tr>
<tr>
<td>gpristine</td>
<td>git reset --hard && git clean -dfx</td>
</tr>
<tr>
<td>gwip</td>
<td>git add -A; git ls-files --deleted -z | xargs -r0 git rm; git commit -m "--wip--"</td>
</tr>
<tr>
<td>gunwip</td>
<td>git log -n 1 | grep -q -c "--wip--" && git reset HEAD~1</td>
</tr>
</table>
<table id="rewriting-history">
<tr>
<th colspan="2">Rewriting History</th>
</tr>
<tr>
<td>grbi</td>
<td>git rebase -i</td>
</tr>
<tr>
<td>grba</td>
<td>git rebase --abort</td>
</tr>
<tr>
<td>grbc</td>
<td>git rebase --continue</td>
</tr>
<tr>
<td>grbs</td>
<td>git rebase --skip</td>
</tr>
<tr>
<td>gcp</td>
<td>git cherry-pick</td>
</tr>
<tr>
<td>gcpa</td>
<td>git cherry-pick --abort</td>
</tr>
<tr>
<td>gcpc</td>
<td>git cherry-pick --continue</td>
</tr>
</table>
<table id="what-changed">
<tr>
<th colspan="2">What changed?</th>
</tr>
<tr>
<td>gbl</td>
<td>git blame -b -w</td>
</tr>
<tr>
<td>gbs</td>
<td>git bisect</td>
</tr>
<tr>
<td>gbsb</td>
<td>git bisect bad</td>
</tr>
<tr>
<td>gbsg</td>
<td>git bisect good</td>
</tr>
<tr>
<td>gbsr</td>
<td>git bisect reset</td>
</tr>
<tr>
<td>gbss</td>
<td>git bisect start</td>
</tr>
<tr>
<td>gd</td>
<td>git diff</td>
</tr>
<tr>
<td>gdca</td>
<td>git diff --cached</td>
</tr>
<tr>
<td>gdt</td>
<td>git diff-tree --no-commit-id --name-only -r</td>
</tr>
<tr>
<td>gdw</td>
<td>git diff --word-diff</td>
</tr>
<tr>
<td>gwch</td>
<td>git whatchanged -p --abbrev-commit --pretty = medium</td>
</tr>
</table>
<table id="ui-tools">
<tr>
<th colspan="2">UI Tools & SVN</th>
</tr>
<tr>
<td>gg</td>
<td>git gui citool</td>
</tr>
<tr>
<td>gga</td>
<td>git gui citool --amend</td>
</tr>
<tr>
<td>gk</td>
<td>gitk --all --branches</td>
</tr>
<tr>
<td>gsd</td>
<td>git svn dcommit</td>
</tr>
<tr>
<td>gsr</td>
<td>git svn rebase</td>
</tr>
<tr>
<td>git-svn-dcommit-push</td>
<td>git svn dcommit && git push github master:svntrunk</td>
</tr>
</table>
<table id="miscellaneous">
<tr>
<th colspan="2">Miscellaneous</th>
</tr>
<tr>
<td>gcf</td>
<td>git config --list</td>
</tr>
<tr>
<td>gcount</td>
<td>git shortlog -sn</td>
</tr>
<tr>
<td>gdct</td>
<td>git describe --tags `git rev-list --tags --max-count=1`</td>
</tr>
<tr>
<td>gignore</td>
<td>git update-index --assume-unchanged</td>
</tr>
<tr>
<td>gunignore</td>
<td>git update-index --no-assume-unchanged</td>
</tr>
<tr>
<td>gignored</td>
<td>git ls-files -v | grep "^[[:lower:]]"</td>
</tr>
<tr>
<td>gts</td>
<td>git tag -s</td>
</tr>
<tr>
<td>gvt</td>
<td>git verify-tag</td>
</tr>
<tr>
<td>gtv</td>
<td>git tag | sort -V</td>
</tr>
<tr>
<td>gsps</td>
<td>git show --pretty = short --show-signature</td>
</tr>
<tr>
<td>grt</td>
<td>cd $(git rev-parse --show-toplevel || echo ".")</td>
</tr>
</table>
</div>
<footer><p class="copyright">Written by <a href="https://twitter.com/hschnedlitz">@hschnedlitz</a>
<p class="github">Source on <a href="https://github.com/hschne/git-aliases">Github</a></p>
<div style="clear: both"></div>
</footer>
</body>
</html>