Thursday, July 28, 2011

How to migrate from git to Mercurial

In this post I'll describe how to migrate from git to Mercurial. In all this process should take approximately 20 minutes.

Migrating from git to Mercurial takes several simple steps:

Create Mercurial repository
You can use various
free source hosting facilities with Mercurial support like: BitBucket, Google Code, CodePlex and others.

Install hg-git extension
Just do:
easy_install hg-git
And add following lines to your ~/.hgrc file:
[extensions]
hgext.bookmarks =
hggit =

Pull your git repository to a local Mercurial repository
After you've installed hg-git you are able to pull and convert git repository with help of hg clone command.
So just do:
hg clone <your-old-git-repository>


Push local Mercurial repository
You're almost done. Now it's time to push you Mercurial repository, so it will be public to other people.
We've converted git to hg on a previous step, so just do:
hg push <your-new-mercurial-repository>

That's all.
Good luck.

No comments:

Post a Comment