-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversion-control.html
More file actions
2656 lines (2616 loc) · 114 KB
/
version-control.html
File metadata and controls
2656 lines (2616 loc) · 114 KB
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
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
<link rel="icon" type="image/gif" href="/favicon.gif"/>
<link rel="apple-touch-icon" sizes="120x120" href="touch-icon-iphone-retina.png" />
<link rel="apple-touch-icon" sizes="152x152" href="touch-icon-ipad-retina.png" />
<title>Lorem Ipsum</title>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<style type="text/css" id="internal-style">
@import url(hyperpolyglot.css);
</style>
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
<meta http-equiv="content-language" content="en"/>
</head>
<body>
<div id="container-wrap-wrap">
<div id="container-wrap">
<div id="container">
<div id="header">
<h1><a href="/"><span>Hyperpolyglot</span></a></h1>
</div>
<div id="content-wrap">
<div id="main-content">
<div id="page-title">Lorem Ipsum</div>
<div id="page-content">
<p><strong><a href="#dvcs">distributed version control</a>:</strong> <a href="#version-help">version and help</a> | <a href="#repository">local and remote repository</a> | <a href="#working-directory">working directory</a> | <a href="#track-commit">track and commit</a> | <a href="#branch-merge">branch and merge</a> | <a href="#history">history</a> | <a href="#pull-push">push and pulll</a> | <a href="#configuration-files">configuration files</a> | <a href="#external-repositories">external repositories</a> | <a href="#packaging">packaging</a> | <a href="#integrity-check-garbage-collection">integrity check and garbage collection</a></p>
<p><strong><a href="#vcs">version control</a>:</strong> <a href="#vcs">svn</a> | <a href="#vcs">cvs</a> | <a href="#vcs">rcs</a></p>
<p><strong><a href="#archive-patch-tools">archive and patch tools</a>:</strong> <a href="#diff">diff</a> | <a href="#cpio">cpio</a> | <a href="#diff3">diff3</a> | <a href="#ar">ar</a> | <a href="#tar">tar</a> | <a href="#patch">patch</a> | <a href="#zip">zip</a> | <a href="#diffstat">diffstat</a> | <a href="#jar">jar</a> | <a href="#rsync">rsync</a> | <a href="#colordiff">colordiff</a></p>
<table class="wiki-content-table">
<tr>
<th colspan="3"><a name="version-help"></a><a href="#version-help-note">version and help</a></th>
</tr>
<tr>
<th></th>
<th><a href="#git">git</a></th>
<th><a href="#hg">hg</a></th>
</tr>
<tr>
<td><a name="show-version"></a><a href="#show-version-note">show version</a></td>
<td>$ git version</td>
<td>$ hg version</td>
</tr>
<tr>
<td><a name="list-subcommands"></a><a href="#list-subcommands-note">list subcommands</a></td>
<td>$ git help -a<br />
<br />
<span style="color: gray"><em>commonly used subcommands only:</em></span><br />
$ git help</td>
<td>$ hg [-v] help<br />
<br />
<span style="color: gray">-v: <em>show aliases and global options</em></span></td>
</tr>
<tr>
<td><a name="help-for-subcommand"></a><a href="#help-for-subcommand-note">get help for subcommand</a></td>
<td>$ git help CMD</td>
<td>$ hg help CMD</td>
</tr>
<tr>
<td><a name="list-topics-guides"></a><a href="#list-topic-guides-note">list topic guides</a></td>
<td>$ git help -g</td>
<td>$ hg help</td>
</tr>
<tr>
<td><a name="help-for-topic"></a><a href="#help-for-topic-note">get help for topic</a></td>
<td>$ git help TOPIC</td>
<td>$ hg help TOPIC</td>
</tr>
<tr>
<th colspan="3"><a name="repository"></a><a href="#repository-note">local and remote repository</a></th>
</tr>
<tr>
<th></th>
<th><a href="#git">git</a></th>
<th><a href="#hg">hg</a></th>
</tr>
<tr>
<td>create repository from a directory</td>
<td>$ git init [DIR]</td>
<td>$ hg init [DIR]</td>
</tr>
<tr>
<td>create repository with no working directory</td>
<td>$ git init <span style="white-space: pre-wrap;">--</span>bare [DIR]<br />
<br />
<span style="color: gray"><em>puts repo in</em> DIR</span></td>
<td><span style="color: gray"><em>none</em></span></td>
</tr>
<tr>
<td>clone entire repository</td>
<td>$ git clone [-b <a href="#BRANCH">BRANCH</a>] [-o NAME] [<span style="white-space: pre-wrap;">--</span>depth NUM] <a href="#URL">URL</a> [DIR]<br />
<br />
<span style="color: gray">-b: <em>checkout</em> BRANCH <em>in working dir</em><br />
-o: <em>assign</em> NAME <em>to remote repo</em><br />
<span style="white-space: pre-wrap;">--</span>depth: <em>copy commit history to depth NUM</em></span></td>
<td> </td>
</tr>
<tr>
<td>repository url formats</td>
<td><span style="color: gray"><span style="white-space: pre-wrap;">ssh://[user@]host.xz[:port]/path/to/repo.git</span><br />
<span style="white-space: pre-wrap;">git://host.xz[:port]/path/to/repo.git</span><br />
<span style="white-space: pre-wrap;">http[s]://host.xz[:port]/path/to/repo.git</span><br />
<span style="white-space: pre-wrap;">ftp[s]://host.xz[:port]/path/to/repo.git</span><br />
<span style="white-space: pre-wrap;">rsync://host.xz/path/to/repo.git</span><br />
<span style="white-space: pre-wrap;">/path/to/repo.git</span><br />
<span style="white-space: pre-wrap;">file:///path/to/repo.git</span></span></td>
<td><span style="color: gray"><span style="white-space: pre-wrap;">local/filesystem/path[#revision]</span><br />
<span style="white-space: pre-wrap;">file://local/filesystem/path[#revision]</span><br />
<span style="white-space: pre-wrap;">http://[user[:pass]@]host[:port]/[path][#revision]</span><br />
<span style="white-space: pre-wrap;">https://[user[:pass]@]host[:port]/[path][#revision]</span><br />
<span style="white-space: pre-wrap;">ssh://[user@]host[:port]/[path][#revision]</span></span></td>
</tr>
<tr>
<td>clone branch from repository</td>
<td> </td>
<td>$ hg clone [-r REV|-b BRANCH] … URL [DIR]</td>
</tr>
<tr>
<td>clone repository; new repository has no working directory</td>
<td>$ git clone <span style="white-space: pre-wrap;">--</span>bare <a href="#URL">URL</a> <span style="white-space: pre-wrap;">[</span><a href="#DIR">DIR</a>]<br />
<br />
<span style="color: gray"><em>puts repo in</em> DIR</span></td>
<td>$ hg clone -U URL [DIR]<br />
<br />
<span style="color: gray"><em>puts repo in</em> DIR/.hg</span></td>
</tr>
<tr>
<td>list remote repositories</td>
<td>$ git [<span style="white-space: pre-wrap;">[</span>-v] show] remote<br />
<br />
<span style="color: gray">-v: <em>show url of remote</em></span></td>
<td>$ hg paths</td>
</tr>
<tr>
<td>add remote repository</td>
<td>$ git remote add [-t <a href="#BRANCH">BRANCH</a>] ... <a href="#NAME">NAME</a> <a href="#URL">URL</a><br />
$ git remote add [-m <a href="#BRANCH">BRANCH</a>] <a href="#NAME">NAME</a> <a href="#URL">URL</a></td>
<td><span style="color: gray"><em>edit the</em> [paths] <em>section of</em> .hg/hgrc</span></td>
</tr>
<tr>
<td>remove remote repository</td>
<td>$ git remote rm <a href="#REMOTE">REMOTE</a></td>
<td> </td>
</tr>
<tr>
<td>rename remote repository</td>
<td>$ git remote rename <a href="#REMOTE">REMOTE</a> <a href="#NAME">NAME</a> </td>
<td> </td>
</tr>
<tr>
<td>show remote repository details</td>
<td>$ git remote show [-n] <a href="#REMOTE">REMOTE</a><br />
<br />
<span style="color: gray">-n: <em>do not connect to remote repo</em></span></td>
<td> </td>
</tr>
<tr>
<td>edit remote repository details</td>
</table>
<p><span style="white-space: pre-wrap;"> </span>BRANCH …|| ||</p>
<table class="wiki-content-table">
<tr>
<th colspan="3"><a name="working-directory"></a><a href="#working-directory-note">working directory</a></th>
</tr>
<tr>
<th></th>
<th><a href="#git">git</a></th>
<th><a href="#hg">hg</a></th>
</tr>
<tr>
<td><a name="checkout-version"></a><a href="#checkout-version-note">check out version</a></td>
<td>$ git checkout [-f] (<a href="#BRANCH">BRANCH</a>|<a href="#TREEISH">TREEISH</a>)<br />
<br />
<span style="color: gray">-f: <em>overwrite changes in working dir and index</em></span></td>
<td>$ hg update [-c|-C] -r <a href="#HG-REV">REV</a><br />
<br />
<span style="color: gray">-c: <em>fail if changes in working dir</em><br />
-C: <em>discard changes in working dir</em></span></td>
</tr>
<tr>
<td>list modified files</td>
<td>$ git status [-s] [<span style="white-space: pre-wrap;">--</span>ignored] <span style="white-space: pre-wrap;">[</span><a href="#PATH">PATH</a>] ...<br />
<br />
<span style="color: gray">-s: <span style="white-space: pre-wrap;"> </span><em>short format</em><br />
<span style="white-space: pre-wrap;">--</span>ignored: <em>also files excluded by</em> .gitignore</span></td>
<td>$ hg status <span style="white-space: pre-wrap;">[</span><a href="#HG-PATH">PATH</a>]</td>
</tr>
<tr>
<td><a name="ignore-file"></a><a href="#ignore-file-note">ignore file</a></td>
<td>.gitignore</td>
<td>.hgignore</td>
</tr>
<tr>
<td>check out specific files</td>
<td>$ git checkout [TREEISH] <span style="white-space: pre-wrap;">--</span> PATHSPEC …</td>
<td>$ hg revert [-C] [-r <a href="#HG-REV">REV</a>] <a href="#HG-PATH">PATH</a> ...<br />
<br />
<span style="color: gray">-C: <em>do not create backups w/ .orig suffix</em></span></td>
</tr>
<tr>
<td>check out from index</td>
<td>$ git checkout -p <a href="#PATHSPEC">PATHSPEC</a> ...</td>
<td><span style="color: gray"><em>no index</em></span></td>
</tr>
<tr>
<td>clear index</td>
<td>$ git reset</td>
<td> </td>
</tr>
<tr>
<td>clear index and working directory</td>
<td>$ git reset <span style="white-space: pre-wrap;">--</span>hard</td>
<td>$ hg revert -C -a</td>
</tr>
<tr>
<td>list or remove untracked files</td>
<td>$ git clean (-f|-n)<br />
<br />
<span style="color: gray">-f: <em>remove untracked files</em><br />
-n: <em>list untracked files</em></span></td>
<td>$ hg purge [-p]<br />
<br />
<span style="color: gray">-p: <em>remove untracked files</em><br />
<br />
<em>without</em> -p <em>untracked files are listed</em></span></td>
</tr>
<tr>
<td>move working directory changes to shelf</td>
<td>$ git stash [push <span style="white-space: pre-wrap;">[</span>-m <a href="#STR">STR</a>]]</td>
<td>$ hg [-n STR] shelve</td>
</tr>
<tr>
<td>list sets of changes in shelf</td>
<td>$ git stash list</td>
<td>$ hg shelve <span style="white-space: pre-wrap;">--</span>list [-p]<br />
<br />
<span style="color: gray">-p: <em>show each set of changes as diff</em></span></td>
</tr>
<tr>
<td>show set of changes in shelf as diff</td>
<td>$ git stash show <span style="white-space: pre-wrap;">[</span><a href="#STASH">STASH</a>]</td>
<td><span style="color: gray"><em>none</em></span></td>
</tr>
<tr>
<td>restore changes from shelf</td>
<td>$ git stash pop <span style="white-space: pre-wrap;">[</span><a href="#STASH">STASH</a>]</td>
<td>$ hg unshelve [STR]</td>
</tr>
<tr>
<td>delete set of changes from shelf</td>
<td>$ git stash drop [STASH]</td>
<td>$ hg shelve -d STR</td>
</tr>
<tr>
<td>clear shelf</td>
<td>$ git stash clear</td>
<td>$ hg shelve <span style="white-space: pre-wrap;">--</span>clear</td>
</tr>
<tr>
<th colspan="3"><a name="track-commit"></a><a href="#track-commit-note">track and commit</a></th>
</tr>
<tr>
<th></th>
<th><a href="#git">git</a></th>
<th><a href="#hg">hg</a></th>
</tr>
<tr>
<td>track files</td>
<td><span style="color: gray"><em>files are not tracked; changes must be added to staging area before each commit</em></span></td>
<td>$ hg add <a href="#HG-PATH">PATH</a> ...</td>
</tr>
<tr>
<td>track files matching pattern</td>
<td> </td>
<td>$ hg add -I <a href="#HG-PATTERN">PATTERN</a></td>
</tr>
<tr>
<td>track all files in working directory</td>
<td> </td>
<td>$ hg add</td>
</tr>
<tr>
<td>add modified or new files to staging area</td>
<td>$ git add <a href="#PATHSPEC">PATHSPEC</a> ...<br />
<br />
<span style="color: gray">-u: <em>files already under version control only</em></span></td>
<td><span style="color: gray"><em>working directory is the staging area</em></span></td>
</tr>
<tr>
<td>add part of modified file to staging area</td>
<td>$ git add -e <a href="#PATH">PATH</a></td>
<td> </td>
</tr>
<tr>
<td>track any new files in working directory, and remove any tracked files not in working directory</td>
<td> </td>
<td>$ hg addremove <span style="white-space: pre-wrap;">[</span><a href="#HG-PATH">PATH</a>] ...</td>
</tr>
<tr>
<td>remove files from working directory and next commit</td>
<td>$ git rm [-f] <a href="#PATH">PATH</a> ...<br />
<br />
<span style="color: gray">-f: <em>force if changed in index</em></span></td>
<td>$ hg remove [-f] <a href="#HG-PATH">PATH</a> ...<br />
<br />
<span style="color: gray">-f: <em>force if added or changed</em></span></td>
</tr>
<tr>
<td>remove files matching pattern</td>
<td>$ git rm [-f] <a href="#PATHSPEC">PATHSPEC</a> ...<br />
<br />
<span style="color: gray">-f: <em>force if changed in index</em></span></td>
<td>$ hg remove [-f] -I <a href="#HG-PATTERN">PATTERN</a><br />
<br />
<span style="color: gray">-f: <em>force if added or changed</em></span></td>
</tr>
<tr>
<td>remove files in next commit which are no longer in working directory</td>
<td> </td>
<td>$ hg remove -A <a href="#HG-PATH">PATH</a> …</td>
</tr>
<tr>
<td>mark file to be removed in next commit without removing from working directory</td>
<td> </td>
<td>$ hg forget <a href="#HG-PATH">PATH</a> ...</td>
</tr>
<tr>
<td>remove subdirectory from working directory and next commit</td>
<td>$ git rm -r <a href="#DIR">DIR</a></td>
<td>$ hg remove <a href="#HG-DIR">DIR</a></td>
</tr>
<tr>
<td>remove files from index</td>
<td>$ git rm <span style="white-space: pre-wrap;">--</span>cached <a href="#FILE">FILE</a> ...</td>
<td> </td>
</tr>
<tr>
<td>copy files from head to index</td>
<td>$ git reset -p <a href="#FILE">FILE</a> ...</td>
<td> </td>
</tr>
<tr>
<td>copy files from index to working directory</td>
<td>$ git checkout -p <a href="#PATH">PATH</a> ...</td>
<td> </td>
</tr>
<tr>
<td><a name="move"></a><a href="#move-note">move file in working directory and next commit</a></td>
<td>$ git mv <a href="#PATH">OLDPATH</a> <a href="#PATH">NEWPATH</a></td>
<td>$ hg rename <a href="#HG-PATH">OLDPATH</a> <a href="#HG-PATH">NEWPATH</a></td>
</tr>
<tr>
<td><a name="move-into-dir"></a><a href="#move-into-dir-note">move files into directory</a></td>
<td>$ git mv <a href="#PATH">PATH</a> ... <a href="#DIR">DIR</a></td>
<td>$ hg rename <a href="#HG-PATH">PATH</a> ... <a href="#HG-DIR">DIR</a></td>
</tr>
<tr>
<td>copy file in working directory and next commit</td>
<td> </td>
<td>$ hg copy (-A|-f) <a href="#HG-PATH">SRC_PATH</a> <a href="#HG-PATH">DEST_PATH</a><br />
<br />
<span style="color: gray">-A: <em>if file already copied</em><br />
-f: <em>if target is tracked</em></span></td>
</tr>
<tr>
<td>show difference between staging area and head</td>
<td>$ git diff <span style="white-space: pre-wrap;">--</span>cached <span style="white-space: pre-wrap;">[</span><a href="#PATHSPEC">PATHSPEC</a> ...]</td>
<td>$ hg diff [PATH …]</td>
</tr>
<tr>
<td>show difference between working directory and staging area</td>
<td>$ git diff <span style="white-space: pre-wrap;">[</span><a href="#PATHSPEC">PATHSPEC</a> ...]</td>
<td><span style="color: gray"><em>working directory and staging area are the same</em></span></td>
</tr>
<tr>
<td>diff options</td>
<td><span style="color: gray"><span style="white-space: pre-wrap;">--</span>name-only: list modified file names<br />
<span style="white-space: pre-wrap;">--</span>name-status: status (M, A, D, R, ..) and modified file names<br />
<span style="white-space: pre-wrap;">--</span>stat: histogram of changes by file<br />
<span style="white-space: pre-wrap;">--</span>dirstat: histogram of changes by directory<br />
<span style="white-space: pre-wrap;">--</span>word-diff: show changes to line inline<br />
<span style="white-space: pre-wrap;">--</span>word-diff-regex=REGEX: set regex used by <span style="white-space: pre-wrap;">--</span>word-diff<br />
-W: show entire modified function in context<br />
<span style="white-space: pre-wrap;"> </span><br />
-R: reverse direction of diff<br />
-w: ignore whitespace differences<br />
<span style="white-space: pre-wrap;">--</span>ignore-blank-lines: ignore blank lines<br />
<span style="white-space: pre-wrap;"> </span><br />
<span style="white-space: pre-wrap;">--</span>quiet: no output; exit status 1 if changes, otherwise 0<br />
<span style="white-space: pre-wrap;"> </span></span></td>
<td><span style="color: gray"><span style="white-space: pre-wrap;"> </span><br />
<span style="white-space: pre-wrap;"> </span><br />
<span style="white-space: pre-wrap;">--</span>stat: histogram of changes by file<br />
<span style="white-space: pre-wrap;"> </span><br />
<span style="white-space: pre-wrap;"> </span><br />
<span style="white-space: pre-wrap;"> </span><br />
-p: show entire modified function in context<br />
-U NUM: show NUM lines of context<br />
<span style="white-space: pre-wrap;">--</span>reverse: reverse direction of diff<br />
-w: ignore whitespace differences<br />
-b: ignore blank lines<br />
-X PATTERN: exclude files matching fileglob<br />
<span style="white-space: pre-wrap;"> </span><br />
-S: recurse into subrepos</span></td>
</tr>
<tr>
<td>grep staging area</td>
<td>$ git grep <span style="white-space: pre-wrap;">--cached</span> [-i] [-v] [-E|F|P] [-h|H] [-l|L] [-n] \<br />
<span style="white-space: pre-wrap;"> </span><span style="white-space: pre-wrap;"> </span>-e STR TREEISH [<span style="white-space: pre-wrap;">--</span>] PATHSPEC</td>
<td> </td>
</tr>
<tr>
<td><a name="commit-changes"></a><a href="#commit-changes-note">commit changes in staging area</a></td>
<td>$ git commit [-a] [-m <a href="#STR">STR</a>]<br />
<br />
<span style="color: gray">-a: <em>add all modified files with version history to staging area before commit.</em></span></td>
<td>$ hg commit [-m <a href="#HG-STR">STR</a>]</td>
</tr>
<tr>
<td>commit changes to selected files in staging area</td>
<td>$ git commit [-m <a href="#STR">STR</a>] <a href="#PATH">PATH</a> ...</td>
<td>$ hg commit [-m <a href="#HG-STR">STR</a>] PATH ...</td>
</tr>
<tr>
<td>commit changes in working directory</td>
<td> </td>
<td>$ hg commit -A [-m <a href="#HG-STR">STR</a>]</td>
</tr>
<tr>
<td>amend most recent commit</td>
<td>$ git commit <span style="white-space: pre-wrap;">--</span>amend</td>
<td>$ hg commit <span style="white-space: pre-wrap;">--</span>amend</td>
</tr>
<tr>
<td>change author of most recent commit</td>
<td>$ git commit <span style="white-space: pre-wrap;">--</span>amend <span style="white-space: pre-wrap;">--</span>author=<a href="#STR">STR</a></td>
<td>$ hg commit <span style="white-space: pre-wrap;">--</span>amend -u STR</td>
</tr>
<tr>
<td><a name="commit-identifiers"></a><a href="#commit-identifiers-note">commit identifiers</a></td>
<td><span style="color: gray"><em>40 hex digit hashes, e.g:</em><br />
<br />
<span style="white-space: pre-wrap;"> </span>bbf3837d6c9bb54f11a4c620a1c81975156c2a49<br />
<br />
<em>A prefix can be used to refer to a commit if it uniquely specifies it; often an 8 digit prefix is sufficient.</em><br />
<br />
HEAD <em>refers to the most recent commit of the current branch.</em></span></td>
<td><span style="color: gray"><em>Each revision has a 40 hex digit hash and a sequential integer identifier. The hash is unique across all repositories, but the sequential integer is local to the repository.</em><br />
<br />
<em>A prefix can be used to refer to a revision if it uniquely specifies it; often an 8 digit prefix is sufficient.</em><br />
<br />
<em>A period . refers to the parent revision of the working directory.</em><br />
<br />
tip <em>refers to the most recent revision in the repository.</em></span></td>
</tr>
<tr>
<td>other ways to refer to commits</td>
<td><span style="color: gray"><em>A circumflex postfix can be used to refer to the parent commit of a commit, e.g.</em><br />
<br />
<span style="white-space: pre-wrap;"> </span>bbf3837d6^<br />
<br />
<em>The circumflex can be used multiple times to refer to a grandparent, great-grandparent, and so on:</em><br />
<br />
<span style="white-space: pre-wrap;"> </span>bbf3837d6<span style="white-space: pre-wrap;">^^</span><br />
<span style="white-space: pre-wrap;"> </span>bbf3837d6<span style="white-space: pre-wrap;">^^^</span><br />
<br />
<em>An alternative to multiple circumflexes is tilde notation:</em><br />
<br />
<span style="white-space: pre-wrap;"> </span>bbf3837d6~2<br />
<span style="white-space: pre-wrap;"> </span>bbf3837d6~3<br />
<br />
<em>when a commit has multiple parents (i.e. the commit is a merge), use a circumflex followed by a number:</em><br />
<br />
<span style="white-space: pre-wrap;"> </span>bbf3837d6^2</span></td>
<td> </td>
</tr>
<tr>
<td>resolve commit notation</td>
<td>$ git rev-parse <a href="#COMMIT">COMMIT</a><br />
<br />
<span style="color: gray"><em>e.g. to get commit id of parent of tip:</em><br />
<br />
<span style="white-space: pre-wrap;"> </span>git rev-parse HEAD^</span></td>
<td> </td>
</tr>
<tr>
<td>create commit which reverts another commit</td>
<td>$ git revert [-n] <a href="#COMMIT">COMMIT</a><br />
<br />
<span style="color: gray">-n: <em>no commit, just change working directory</em></span></td>
<td>$ hg backout -r <a href="#HG-REV">REV</a></td>
</tr>
<tr>
<td>create commit which reverts a merge commit</td>
<td>$ git revert [-n] -m NUM <a href="#COMMIT">COMMIT</a><br />
<br />
<span style="color: gray">NUM <em>is the number of the parent (e.g. 1, 2, ...) to restore</em></span></td>
<td> </td>
</tr>
<tr>
<td>create commits which revert a sequence of commits</td>
<td>$ git revert [-n] <a href="#COMMIT">COMMIT1</a>..<a href="#COMMIT">COMMIT2</a><br />
<br />
<span style="color: gray">//reverts commits from// COMMIT1 //up to but not including// COMMIT2. //Use triple dots// <span style="white-space: pre-wrap;">...</span> <em>to include</em> COMMIT2.</span></td>
<td> </td>
</tr>
<tr>
<td>tag a commit</td>
<td>$ git tag [-f] <a href="#NAME">NAME</a> <span style="white-space: pre-wrap;">[</span><a href="#COMMIT">COMMIT</a>]<br />
<br />
<span style="color: gray">-f: <em>replace existing tag with same</em> NAME</span><br />
<br />
<span style="color: gray"><em>if no commit specified,</em> HEAD <em>is tagged</em></span></td>
<td>$ hg tag [-r <a href="#HG-REV">REV</a>] <a href="#HG-NAME">NAME</a></td>
</tr>
<tr>
<td>delete a tag</td>
<td>$ git tag -d <a href="#TAG">TAG</a></td>
<td>$ hg tag <span style="white-space: pre-wrap;">--</span>remove <a href="#HG-NAME">NAME</a></td>
</tr>
<tr>
<td>list tags</td>
<td>$ git tag</td>
<td>$ hg tags</td>
</tr>
<tr>
<th colspan="3"><a name="branch-merge"></a><a href="#branch-merge-note">branch and merge</a></th>
</tr>
<tr>
<th></th>
<th><a href="#git">git</a></th>
<th><a href="#hg">hg</a></th>
</tr>
<tr>
<td>current branch</td>
<td>$ git rev-parse <span style="white-space: pre-wrap;">--</span>abbrev-ref HEAD</td>
<td> </td>
</tr>
<tr>
<td>list branches</td>
<td>$ git branch [-r|-a]<br />
<br />
<span style="color: gray">-r: list remote tracking branches<br />
-a: list local and remote tracking branches</span></td>
<td>$ hg bookmarks</td>
</tr>
<tr>
<td>list branches containing commit</td>
<td>$ git branch (<span style="white-space: pre-wrap;">--</span>contains|<span style="white-space: pre-wrap;">--</span>merged) COMMIT<br />
<br />
<span style="color: gray"><span style="white-space: pre-wrap;">--</span>contains: branches descended from COMMIT<br />
<span style="white-space: pre-wrap;">--</span>merged:branches ancestors of COMMIT</span></td>
<td> </td>
</tr>
<tr>
<td>list branches by most recent commit</td>
<td>$ git branch <span style="white-space: pre-wrap;">--</span>sort=-committerdate</td>
<td> </td>
</tr>
<tr>
<td>checkout branch</td>
<td>$ git checkout BRANCH<br />
<br />
<span style="color: gray">-f: discard changes in index and working directory</span></td>
<td>$ hg update BRANCH<br />
<br />
<span style="color: gray">-C: discard changes in working directory<br />
-c: fail if changes in working directory</span></td>
</tr>
<tr>
<td>move branch head without changing working directory</td>
<td>$ git reset [<span style="white-space: pre-wrap;">--</span>soft] COMMIT</td>
<td> </td>
</tr>
<tr>
<td>create new branch by cloning branch</td>
<td>$ git checkout -b NAME [BRANCH]</td>
<td>$ hg bookmarks NAME</td>
</tr>
<tr>
<td>create a tracking branch</td>
<td>$ git branch <span style="white-space: pre-wrap;">--</span>track NAME [BRANCH]</td>
<td> </td>
</tr>
<tr>
<td>create a branch from a commit</td>
<td>$ git branch NAME COMMIT</td>
<td>$ hg bookmarks -r REV NAME</td>
</tr>
<tr>
<td>rename a branch</td>
<td>$ git branch -m BRANCH NAME</td>
<td>$ hg bookmarks -m NAME1 NAME2</td>
</tr>
<tr>
<td>delete a branch</td>
<td>$ git branch (-d|-D) BRANCH<br />
<br />
<span style="color: gray">-d: fail if tracking branch with unmerged commits<br />
-D: delete even if unmerged commits exist</span></td>
<td>$ hg bookmarks -d NAME</td>
</tr>
<tr>
<td><a name="list-dedicated-commit-branches"></a><a href="#list-dedicated-commit-branches-note">list "dedicated commit" branches</a></td>
<td> </td>
<td>$ hg branches</td>
</tr>
<tr>
<td>show current "dedicated commit" branch</td>
<td> </td>
<td>$ hg branch</td>
</tr>
<tr>
<td>change branch of next commit</td>
<td> </td>
<td>$ hg branch BRANCH</td>
</tr>
<tr>
<td>list branch tips</td>
<td> </td>
<td>$ hg heads [-c]<br />
<br />
<span style="color: gray">-c: include closed tips</span></td>
</tr>
<tr>
<td>close branch tip</td>
<td> </td>
<td>$ hg commit <span style="white-space: pre-wrap;">--</span>close-branch</td>
</tr>
<tr>
<td>merge</td>
<td>$ git merge [<span style="white-space: pre-wrap;">--</span>squash] COMMIT ...<br />
<br />
<span style="color: gray"><span style="white-space: pre-wrap;">--</span>squash: make changes to index and working directory only; do not create a commit</span></td>
<td>$ hg merge [[-r] REV]<br />
<br />
<span style="color: gray"><em>Only modifies working directory; must be following by</em> hg commit <em>to create a new changeset.</em></span></td>
</tr>
<tr>
<td>show conflicts</td>
<td>$ git status</td>
<td>$ hg resolve -l</td>
</tr>
<tr>
<td>mark file with conflicts as resolved</td>
<td>$ git add PATH</td>
<td>$ hg resolve PATH</td>
</tr>
<tr>
<td>unmark file with conflicts as resolved</td>
<td> </td>
<td>$ hg resolve -u PATH</td>
</tr>
<tr>
<td>abort merge</td>
<td>$ git merge <span style="white-space: pre-wrap;">--</span>abort</td>
<td>$ hg update -C</td>
</tr>
<tr>
<td>rebase current branch</td>
<td>$ git rebase BRANCH</td>
<td> </td>
</tr>
<tr>
<td>continue rebase</td>
<td>$ git rebase <span style="white-space: pre-wrap;">--</span>continue</td>
<td> </td>
</tr>
<tr>
<td>abort rebase</td>
<td>$ git rebase <span style="white-space: pre-wrap;">--</span>abort</td>
<td> </td>
</tr>
<tr>
<td>squash commits</td>
<td>$ git rebase -i COMMIT<br />
<br />
<span style="color: gray">commits after COMMIT can be squashed; change all after first from "pick" to "squash"</span></td>
<td> </td>
</tr>
<tr>
<td>apply commit to current branch</td>
<td>$ git cherry-pick COMMIT </td>
<td>$ hg graft -r REV</td>
</tr>
<tr>
<td>continue cherry pick</td>
<td>$ git cherry-pick <span style="white-space: pre-wrap;">--</span>continue</td>
<td> </td>
</tr>
<tr>
<td>abort cherry pick</td>
<td>$ git cherry-pick <span style="white-space: pre-wrap;">--</span>abort</td>
<td> </td>
</tr>
<tr>
<td>create detached head from branch and sequence of commits</td>
<td>$ git rebase <span style="white-space: pre-wrap;">--</span>onto BRANCH COMMIT1 COMMIT2</td>
<td> </td>
</tr>
<tr>
<th colspan="3"><a name="history"></a><a href="#history-note">history</a></th>
</tr>
<tr>
<th></th>
<th><a href="#git">git</a></th>
<th><a href="#hg">hg</a></th>
</tr>
<tr>
<td>write version of file to standard out</td>
<td>$ git show COMMIT:FILE</td>
<td>$ hg cat -r REV FILE</td>
</tr>
<tr>
<td>annotate lines of file with commit info</td>
<td>$ git blame [-l] [-s] [-s] <a href="#PATH">PATH</a> [[#COMMIT COMMIT]]<br />
<br />
<span style="color: gray">-l: <em>show full commit id (default is 8 chars)</em><br />
-s: <em>suppress author name and timestamp</em><br />
-w: <em>ignore whitespace differences</em></span></td>
<td>$ hg annotate -cudln [-r <a href="#HG-REV">REV</a>] <span style="white-space: pre-wrap;">[</span><a href="#HG-PATH">PATH</a>]<br />
<br />
<span style="color: gray">-c: <em>changeset</em><br />
-u: <em>author</em><br />
-d: <em>date</em><br />
-l: <em>line number</em><br />
-n: <em>local revision number</em></span></td>
</tr>
<tr>
<td>commits which are ancestors of head/tip</td>
<td>$ git log [<span style="white-space: pre-wrap;">--</span>parents]<br />
<br />
<span style="color: gray"><span style="white-space: pre-wrap;">--</span>parents: <em>after commit identifier show parent commit identifiers</em></span></td>
<td>$ hg log</td>
</tr>
<tr>
<td>commits as graph</td>
<td>$ git log <span style="white-space: pre-wrap;">--</span>graph</td>
<td>$ hg log -G</td>
</tr>
<tr>
<td>first parent history</td>
<td>$ git log <span style="white-space: pre-wrap;">--</span>first-parent</td>
<td> </td>
</tr>
<tr>
<td>chronological order</td>
<td>$ git log <span style="white-space: pre-wrap;">--</span>reverse</td>
<td> </td>
</tr>
<tr>
<td>all commits in repository</td>
<td>$ git log [<span style="white-space: pre-wrap;">--</span>source] <span style="white-space: pre-wrap;">--</span>all<br />
<br />
<span style="color: gray"><span style="white-space: pre-wrap;">--</span>source: <em>print ref name after each commit</em></span></td>
<td> </td>
</tr>
<tr>
<td>limit commits</td>
<td>$ git log [<span style="white-space: pre-wrap;">--</span>skip=NUM] -(n NUM|-NUM)<br />
<br />
<span style="color: gray"><span style="white-space: pre-wrap;">--</span>skip: <em>skip first NUM commits</em></span></td>
<td> </td>
</tr>
<tr>
<td>commits which touched files</td>
<td>$ git log [<span style="white-space: pre-wrap;">--</span>follow] [<span style="white-space: pre-wrap;">--</span>] PATH ...<br />
<br />
<span style="color: gray"><span style="white-space: pre-wrap;">--</span>follow: <em>follow renamed files</em><br />
<span style="white-space: pre-wrap;">--</span>: <em>prevent interpreting</em> PATH <em>as option</em></span></td>
<td>$ hg log [-f] PATH ...<br />
<br />
<span style="color: gray">-f: <em>follow copied and renamed files</em></span></td>
</tr>
<tr>
<td>commits which touched lines</td>
<td>$ git log -L NUM,NUM:PATH</td>
<td> </td>
</tr>
<tr>
<td>one line commits</td>
<td>$ git log <span style="white-space: pre-wrap;">--</span>oneline</td>
<td> </td>
</tr>
<tr>
<td>format string for commit</td>
<td>$ git log <span style="white-space: pre-wrap;">--</span>pretty=format:FORMAT<br />
<br />
<span style="color: gray"><em>format string specifiers:</em><br />
<br />
%H commit hash<br />
%h abbrev. commit hash<br />
%T tree hash<br />
%t abbrev. tree hash<br />
%P parent hash(es)<br />
%p abbrev. parent hash(es)<br />
%s subject<br />
%b body<br />
%an author name<br />
%ae author email<br />
%ad author date<br />
%cn committer name<br />
%ce committer email<br />
%cd committer date<br />
%n newline<br />
%% percent sign</span></td>
<td> </td>
</tr>
<tr>
<td>show commit diffs</td>
<td>$ git log -p</td>
<td> </td>
</tr>
<tr>
<td>show commits touching lines matching regular expression</td>
<td>$ git log -p [<span style="white-space: pre-wrap;">--</span>pickaxe-all] -G REGEX</td>
<td>$ hg grep PATTERN</td>
</tr>
<tr>
<td>grep commit messages</td>
<td>$ git log <span style="white-space: pre-wrap;">--</span>grep=REGEX</td>
<td>$ hg log <span style="white-space: pre-wrap;">--</span>keyword STR<br />
<br />
<span style="color: gray"><em>case insensitive search; also searches source</em></span></td>
</tr>
<tr>
<td>show changes to head</td>
<td>$ git reflog<br />
<br />
<span style="color: gray">The output format is:<br />
<br />
<span style="white-space: pre-wrap;"> </span><commit> HEAD@{<num>} <description<br />
<br />
<num> is the number of changes since HEAD was at <commit>. HEAD@{<num>} can be used as an alias for <commit>.</span><br />
<br />
<span style="color: gray">This outputs reflog info in log style:</span><br />
<br />
$ git log -g</td>
<td> </td>
</tr>
<tr>
<td>difference between commit and its parent</td>
<td>$ git diff <span style="white-space: pre-wrap;">[--</span>name-only<span style="white-space: pre-wrap;">]</span> <a href="#COMMIT">COMMIT</a>^ <a href="#COMMIT">COMMIT</a> [<span style="white-space: pre-wrap;">--</span>] [PATH ...]</td>
<td>$ hg diff -c <a href="#HG-REV">REV</a> <span style="white-space: pre-wrap;">[</span><a href="#HG-PATH">PATH</a> ...]</td>
</tr>
<tr>
<td>difference between two comits</td>
<td>$ git diff <span style="white-space: pre-wrap;">[--</span>name-only<span style="white-space: pre-wrap;">]</span> <a href="#COMMIT">COMMIT1</a> <a href="#COMMIT">COMMIT2</a> [<span style="white-space: pre-wrap;">--</span>] [PATH ...]</td>
<td>$ hg diff -r <a href="#HG-REV">REV1</a> -r <a href="#HG-REV">REV2</a> <span style="white-space: pre-wrap;">[</span><a href="#HG-PATH">PATH</a> ...]</td>
</tr>
<tr>
<td>diff options</td>
<td><span style="color: gray"><span style="white-space: pre-wrap;">--</span>name-only: list modified file names<br />
<span style="white-space: pre-wrap;">--</span>name-status: status (M, A, D, R, ..) and modified file names<br />
<span style="white-space: pre-wrap;">--</span>stat: histogram of changes by file<br />
<span style="white-space: pre-wrap;">--</span>dirstat: histogram of changes by directory<br />
<span style="white-space: pre-wrap;">--</span>word-diff: show changes to line inline<br />
<span style="white-space: pre-wrap;">--</span>word-diff-regex=REGEX: set regex used by <span style="white-space: pre-wrap;">--</span>word-diff<br />
-W: show entire modified function in context<br />
<span style="white-space: pre-wrap;"> </span><br />
-R: reverse direction of diff<br />
-w: ignore whitespace differences<br />
<span style="white-space: pre-wrap;">--</span>ignore-blank-lines: ignore blank lines<br />
<span style="white-space: pre-wrap;"> </span><br />
<span style="white-space: pre-wrap;">--</span>quiet: no output; exit status 1 if changes, otherwise 0<br />
<span style="white-space: pre-wrap;"> </span></span></td>
<td><span style="color: gray"><span style="white-space: pre-wrap;"> </span><br />
<span style="white-space: pre-wrap;"> </span><br />
<span style="white-space: pre-wrap;">--</span>stat: histogram of changes by file<br />
<span style="white-space: pre-wrap;"> </span><br />
<span style="white-space: pre-wrap;"> </span><br />
<span style="white-space: pre-wrap;"> </span><br />
-p: show entire modified function in context<br />
-U NUM: show NUM lines of context<br />
<span style="white-space: pre-wrap;">--</span>reverse: reverse direction of diff<br />
-w: ignore whitespace differences<br />
-b: ignore blank lines<br />
-X PATTERN: exclude files matching fileglob<br />
<span style="white-space: pre-wrap;"> </span><br />
-S: recurse into subrepos</span></td>
</tr>
<tr>
<td>grep commit</td>
<td>$ git grep [-i] [-v] [-E|F|P] [-h|H] [-l|L] [-n] \<br />
<span style="white-space: pre-wrap;"> </span><span style="white-space: pre-wrap;"> </span>-e <a href="#STR">STR</a> <a href="#TREEISH">TREEISH</a> <span style="white-space: pre-wrap;">[--]</span> <a href="#PATHSPEC">PATHSPEC</a></td>
<td> </td>
</tr>
<tr>
<td>start bisection</td>
<td>$ git bisect <a href="#COMMIT">BAD_COMMIT</a> <a href="#COMMIT">GOOD_COMMIT</a></td>
<td> </td>
</tr>
<tr>
<td>mark bisection commit as good</td>
<td>$ git bisect good</td>
<td> </td>
</tr>
<tr>
<td>mark bisection commit as bad</td>
<td>$ git bisect bad</td>
<td> </td>
</tr>
<tr>
<td>mark bisection commits automatically</td>
<td>$ git bisect run SCRIPT [ARG]...<br />
<br />
<span style="color: gray"><em>Exit status of 0 indicates a good commit. Exit status of 125 indicates an untestable commit. Any other status in the range 1...127 indicates a bad commit.</em></span></td>
<td> </td>
</tr>
<tr>
<td>show bisection decisions</td>
<td>$ git bisect log</td>
<td> </td>
</tr>
<tr>
<td>terminate bisection</td>
<td>$ git bisect reset</td>
<td> </td>
</tr>
<tr>
<th colspan="3"><a name="pull-push"></a><a href="#pull-push-note">push and pull</a></th>
</tr>
<tr>
<th></th>
<th><a href="#git">git</a></th>
<th><a href="#hg">hg</a></th>
</tr>
<tr>
<td>pull commits from remote</td>
<td>$ git fetch [-f] [-t] [-p] [REPO]<br />
<br />
<span style="color: gray">-f: force if update not a fast-forward<br />
-t: copy tags<br />
-p: remove local references gone from remote<br />
<br />
<em>Pulls from origin if REPO not specified.</em><br />
<br />
<em>Updates remote tracking branches per refspec of REPO in .git/config.</em></span></td>
<td>$ hg pull [-u] [SOURCE]<br />
<br />
<span style="color: gray">-u: <em>update working directory to most recent changeset</em></span><br />
<br />
<span style="color: gray"><em>Pushes all revisions in local repository not on remote repository.</em></span><br />
<br />
<span style="color: gray"><em>If no SOURCE specified, uses value of default in the [paths] section of .hg/hgrc.</em></span></td>
</tr>
<tr>
<td>pull commits from remote for branch</td>
<td>$ git fetch [-f] [-t] [-p] REPO REFSPEC</td>
<td>$ hg pull (-b BRANCH|-B BOOKMARK|-r REV) … [SOURCE]<br />
<br />
<span style="color: gray">-b: <em>pull revisions on BRANCH and parents</em><br />
-B: <em>pull BOOKMARKed revision and parents</em><br />
-r: <em>pull REV and parents</em></span></td>
</tr>
<tr>
<td>pull commits from multiple remotes</td>
<td>$ git fetch [-f] [-t] [-p] (<span style="white-space: pre-wrap;">--</span>all|<span style="white-space: pre-wrap;">--</span>multiple REPO …)</td>
<td> </td>
</tr>
<tr>
<td>show remote commits available for pulling</td>
<td> </td>
<td>$ hg incoming</td>
</tr>
<tr>
<td>pull commits from remote and merge current branch with remote head</td>
<td>$ git pull [-f] REPO [REFSPEC]</td>
<td> </td>
</tr>
<tr>
<td>push commits to remote</td>
<td>$ git push [-f] [<span style="white-space: pre-wrap;">--</span>prune] [<span style="white-space: pre-wrap;">--</span>tags] <span style="white-space: pre-wrap;">[</span><a href="#REPO">REPO</a><span style="white-space: pre-wrap;">]</span></td>
<td>$ hg push [-f] [SOURCE]</td>
</tr>
<tr>
<td>push commits to remote for branch</td>
<td>$ git push [-f] [-u] <a href="#REPO">REPO</a> <span style="white-space: pre-wrap;">[</span>BRANCH<span style="white-space: pre-wrap;">]</span> …</td>
<td>$ hg push [<span style="white-space: pre-wrap;">--</span>new-branch] (-b BRANCH|-B BOOKMARK|-r REV) … [SOURCE]</td>
</tr>
<tr>
<td>delete remote branches</td>
<td>$ git push <span style="white-space: pre-wrap;">--</span>delete <a href="#REPO">REPO</a> <a href="#BRANCH">BRANCH</a> ...</td>
<td> </td>
</tr>
<tr>
<td>show commits which have not been pushed</td>
<td> </td>
<td>$ hg outgoing</td>
</tr>
<tr>