Days ago I just published a short blog post about using Mercurial as a SVN Client, I know, Subversion is the “now-legacy-vcs-system” and Git with Mercurial are the “cool kids” in the school, why not make them work together?
Well, in the same way we could make Subversion works with Hg (using extensions of course) we could make Git works with Mercurial. It requires a little more work in Windows but it stills easy to do. As usual we start with a TortoiseHg installation. I will try to show its installation in a short set of steps:
- We need to activate the Mercurial Bookmark and rebase extensions (these extensions are included with standard Mercurial installation). Edit your mercurial.ini file and add the following to the
[extensions]section
[extensions] rebase = hgext.bookmarks =
hg clone http://bitbucket.org/abderrahim/dulwich hg clone http://bitbucket.org/durin42/hg-git __init__.py and add look for the following code and add the code highlighted
import os
# NOTE: Added for tortoisehg compatibility
import sys
sys.path.append('write here the directory where dulwich was cloned')
from mercurial import commands, extensions, hg, util as hgutil
from mercurial.i18n import _
[extensions] section
hggit = directory where hggit where clonedhggit
And that is all, just test your extension installation with hg help extensions And look for hggit
Now you can clone, rebase, push, pull and do whatever you do with mercurial but using remote git repositories, for example, now you can do something like
hg clone http://github.com/castleproject/Castle.Core.git castle
I hope this guide could help you to get more fun from Mercurial, see you later!
