Install Mercurial with the Git Extension on Windows 7
In the wondrous spirit of free software, this is a little more confusing than it should be, and there are many permutations possible that lead to roughly the same end result, so here's a quick recipe that worked for me circa Jan 2013 on Windows 7:
- Install Git for Windows if you don't already have it. You need this to get the Mercurial hggit extension working, even if you never intend to use git directly afterwards.
- Go here: http://code.google.com/p/msysgit/downloads/list?q=full+installer+official+git and get the latest stable-looking version. I used http://code.google.com/p/msysgit/downloads/detail?name=Git-1.8.0-preview20121022.exe&can=2&q=full+installer+official+git
- Run the installer you just downloaded.
- Start up a CMD shell
- Set HOME to be where your home is going to be. On Windows 7, that's going to be C:\Users\yournamehere. I used this command, for example:
- setx HOME C:\Users\sbarber
- Install TortoiseHG
- On Windows 7 64 bit, I used http://bitbucket.org/tortoisehg/files/downloads/tortoisehg-2.6.2-hg-2.4.2-x64.msi
- If you have installed TortoiseHG, you probably don't need to separately install the command line Mercurial client package because it's bundled with TortoiseHG
- Download the hggit extension to your machine. Here I put it in %HOME%/hg, but you can use another location so long as you're consistent:
- cd %HOME%
- mkdir hg
- cd hg
- git clone http://bitbucket.org/durin42/hg-git/
- Make a Mercurial.ini file in your %USERPROFILE% dir that contains this text:, substituting your username for sbarber:
[extensions] hgext.bookmarks = hggit = c:/Users/sbarber/hg/hg-git/hggit
- That's all you need for unsecured Git repositories. If I get around to accessing secured Git repositories with Mercurial, I'll update this post.
A handy post on this topic that I used as a guide to create this one is http://candidcode.com/2010/01/12/a-guide-to-converting-from-mercurial-hg-to-git-on-a-windows-client/. It's a little out of date but a bit broader in terms of handling some variations that occur on different Windows versions.


2 Comments:
Huh? Isn't hg-git self-contained anymore?
I don't need Git executables at all on my Windows 7 machine to use Mercurial with the hg-git extension.
hg-git extension is e68814 (0.3.2+14) for THG 2.4 .
You don't need git executables to run hg-git. But you do need some way of getting hg-git onto your machine in the first place. I chose to get hg-git from the primary repo at bitbucket using git clone as recommended at BitBucket 101 (https://confluence.atlassian.com/x/cgozDQ). There may be other ways, but I don't know them. Suggestions welcome!
Post a Comment
<< Home