Git – Using Mercurial repository inside a Git one: Feasible? Sane

gitmercurialversion control

I am thinking on creating a Mercurial repository under a Git repository.
e.g.

..../git-repository/directory/hg-repo/

The 2 repositories

Is it possible to manage (keeping your sanity)? How similiar is it to this?


I am a computer science student at University. I manage my work in Git, mainly as a distribution mechanism (after realizing that rsync fails when you have changes in more than one place) between my desktop and usb drive. I try use of Git as a VCS as I do work.

I have finished a semester where I did a small group project to prepare for a larger group project next year. We had to use Subversion, and experienced the joys of a centralised VCS (including downtime).

I tried to keep the subversion repository separate to my Git repository for the subject**, however it was annoying that it was seperate (not in the place where I store assignments). I therefore moved to using an Subversion repository inside my Git repository.

As I think ahead (maybe I am thinking too far ahead) I realise that I will have to try and convince people to use a DVCS and Mercurial will probably be the one that is preferred (Windows and Mac GUI support, closer to Subversion).

Having done some research into the whole Git vs Mercurial debate (however not used Mercurial at all) I still prefer Git.

Can I have a Mercurial repository inside a Git one without going mad (or it ruining something)? Or is it something that I should not consider at all?

(Or is it a bad question that should be deleted?)

** I think outside of Australia it is called a course

Best Answer

Take a look at the hg-git extension for Mercurial, http://hg-git.github.com/. It allows you to access a Git repository (including pulling, pushing, and committing) using Mercurial. I use it to manage my projects on Github using TortoiseHg on Windows. Haven't had a problem with this approach yet.