@@ -46,6 +46,8 @@ <h1 class="tbar"><small>the</small> Hg-Git <small>mercurial plugin</small></h1>
46
46
< div class ='section '>
47
47
< div class ="title "> Commands</ div >
48
48
49
+ < h3 > Clone a Git repository</ h3 >
50
+
49
51
< p >
50
52
You can clone a Git repository from Mercurial by
51
53
running < code > hg clone [url]</ code > . It will create a
@@ -58,6 +60,10 @@ <h1 class="tbar"><small>the</small> Hg-Git <small>mercurial plugin</small></h1>
58
60
59
61
< pre > hg clone git://github.com/schacon/munger.git</ pre >
60
62
63
+ < p > And you're off!</ p >
64
+
65
+ < h3 > Push an existing Hg repository to Git</ h3 >
66
+
61
67
< p >
62
68
If you are starting from an existing Mercurial repository,
63
69
you have to setup a Git repository somewhere that you have
@@ -66,21 +72,27 @@ <h1 class="tbar"><small>the</small> Hg-Git <small>mercurial plugin</small></h1>
66
72
</ p >
67
73
68
74
< pre > $ cd mercurial-repo
69
- $ hg bookmark -r default master # so a ref gets created
70
- $ hg push git+ssh://git@github.com/schacon/some-repo.git
71
- $ hg push</ pre >
75
+ $ hg bookmark -r default master # so a ref gets created</ pre >
72
76
73
77
< p >
74
- This will convert all our Mercurial data into Git objects
75
- and push them up to the Git server. You can also put that
76
- path in the < code > [paths]</ code > section of .hg/hgrc and
77
- then push to it by name.
78
+ To avoid specifying the repo path when you push and pull,
79
+ edit < code > .hg/hgrc</ code > and add:
80
+ </ p >
81
+
82
+ < pre > [paths]
83
+ default = git+ssh://git@github.com/schacon/some-repo.git</ pre >
84
+
85
+ < p >
86
+ See
87
+ < a href ="https://www.selenic.com/mercurial/hgrc.5.html#paths ">
88
+ the Mercurial docs</ a > for more detail on path settings.
78
89
</ p >
79
90
91
+ < pre > $ hg push</ pre >
92
+
80
93
< p >
81
- Now that you have a Mercurial repository that can push/pull
82
- to/from a Git repository, you can get updates
83
- with < code > hg pull</ code > .
94
+ This will convert all our Mercurial data into Git objects
95
+ and push them up to the Git server.
84
96
</ p >
85
97
86
98
< pre > $ hg pull</ pre >
0 commit comments