I\'ve already tried hg2git through fast-export and I\'ve already tried hg-git.
Both with no success. hg2git actually worked, but I had to ask a friend who runs a Uni
Here is a simple example of how to export your local clone of a Mercurial repo to GitHub.
First, add the hggit
extension to your ~/.hgrc
file if you have not already done so:
[extensions]
hggit =
Then run the following commands from the root of your Mercurial repository:
hg bookmark -r default master
hg push -f git+ssh://git@github.com/bolinfest/plovr.git
Personally, I had to specify -f
when running hg push
, though I suspect it is because I had some complicated branches in my Mercurial repo. You may not find it necessary for your migration.
Make sure that you have the git+ssh:
URI to your GitHub repo rather than the git:
URI. (The git+ssh:
URI is a bit harder to find in the new GitHub UI.)
Depending on the size of your repo, running hg push
may take awhile, so be patient. When you are done, you should be able to see your project on GitHub. In this example, my project was available at https://github.com/bolinfest/plovr.
As you would expect, now anyone can clone your public GitHub repo as follows:
git clone git@github.com:bolinfest/plovr.git