Skip to content

Commit 29b2c1a

Browse files
committed
Merge pull request #18 from dbenamy/master
Made instructions clearer
2 parents 45bdd0c + 2f77bfd commit 29b2c1a

File tree

1 file changed

+21
-23
lines changed

1 file changed

+21
-23
lines changed

index.html

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -46,41 +46,39 @@ <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+
51+
<pre>hg clone git://github.com/schacon/some-repo.git</pre>
52+
4953
<p>
50-
You can clone a Git repository from Mercurial by
51-
running <code>hg clone [url]</code>. It will create a
52-
directory with the same name as the last path component. For
53-
example, if you were to run <code>hg clone
54-
git://github.com/schacon/munger.git</code> it would clone
55-
the repository down into the directory 'munger.git', then
56-
convert it to a Mercurial repository for you.
54+
Like with normal <code>hg clone</code>, you can optionally
55+
specify a destination directory.
5756
</p>
5857

59-
<pre>hg clone git://github.com/schacon/munger.git</pre>
58+
<h3>Push an existing Hg repository to Git</h3>
59+
60+
<pre>$ cd mercurial-repo
61+
$ hg bookmark -r default master # so a ref gets created</pre>
6062

6163
<p>
62-
If you are starting from an existing Mercurial repository,
63-
you have to setup a Git repository somewhere that you have
64-
push access to, and then run <code>hg push [path]</code>
65-
from within your project. For example:
64+
To avoid specifying the repo path when you push and pull,
65+
edit <code>.hg/hgrc</code> and add:
6666
</p>
6767

68-
<pre>$ cd hg-git # (a Mercurial repository)
69-
$ hg bookmark -r default master # make a bookmark of master for default, so a ref gets created
70-
$ hg push git+ssh://git@github.com/schacon/hg-git.git
71-
$ hg push</pre>
68+
<pre>[paths]
69+
default = git+ssh://git@github.com/schacon/some-repo.git</pre>
7270

7371
<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.
72+
See
73+
<a href="https://www.selenic.com/mercurial/hgrc.5.html#paths">
74+
the Mercurial docs</a> for more detail on path settings.
7875
</p>
7976

77+
<pre>$ hg push</pre>
78+
8079
<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>.
80+
This will convert all Mercurial data into Git objects
81+
and push them up to the Git server.
8482
</p>
8583

8684
<pre>$ hg pull</pre>

0 commit comments

Comments
 (0)