Skip to content

Commit 1055d33

Browse files
committed
Added path setup when pushing existing repo & deduped steps
1 parent 3c211ee commit 1055d33

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

index.html

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ <h1 class="tbar"><small>the</small> Hg-Git <small>mercurial plugin</small></h1>
4646
<div class='section'>
4747
<div class="title">Commands</div>
4848

49+
<h3>Clone a Git repository</h3>
50+
4951
<p>
5052
You can clone a Git repository from Mercurial by
5153
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>
5860

5961
<pre>hg clone git://github.com/schacon/munger.git</pre>
6062

63+
<p>And you're off!</p>
64+
65+
<h3>Push an existing Hg repository to Git</h3>
66+
6167
<p>
6268
If you are starting from an existing Mercurial repository,
6369
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>
6672
</p>
6773

6874
<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>
7276

7377
<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.
7889
</p>
7990

91+
<pre>$ hg push</pre>
92+
8093
<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.
8496
</p>
8597

8698
<pre>$ hg pull</pre>

0 commit comments

Comments
 (0)