Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Ill explain my problem,

I am currently using an in-house install of gitorious using git. I would like to begin testing FogBugz and Kiln from Fog Creek which uses mercurial. I would like to for at a least a short while continue development using both solutions.

Does anyone know of any long term serious effects of having a git and a mercurial repo in the same directory. Or is there a better way of keeping git and mercurial server in sync.

Ive tried it with a test repo and I haven't seen any issues.

Thanks for any help.

share|improve this question
I don't think there would be much of an issue, as they are both isolated unlike svn's .svn files. –  Josh K Aug 30 '11 at 20:57
add comment

2 Answers

up vote 7 down vote accepted

I've found the hg-git bridge fairly usable going the other direction (exposing some stuff on Github that was originally built using Mercurial for source control). Basically, you "just" use mercurial, create a bookmark linking "master" to the "default" when you're ready to push to a git repo, and push. Pull from git works similarly to the way it does when you pull from a remote repo. You don't end up with .git + .hg files in this scenario, you just have mercurial ones on your local box, unless you end up migrating over to git entirely, in which case you'd probably do git clone in a new directory.

There's a similar project for git users that want to push/pull from Mercurial repositories, but I don't have direct experience with it. See https://github.com/offbytwo/git-hg

Other than the potential of accidentally checking in a bunch of the hidden folders from your "other" source control system, I don't see any real problem with doing hg init in a git repo; it just seems less clunky to me to use a bridge, and explicitly choose when to push to the other dvcs system.

share|improve this answer
I've found hg-git a bit hit & miss with SSH and it's less than fun to set up. You can run both DVCS clients on the same machine, no probs. In fact if you're using one for source control and the other to push to production (Azure, Appharbor etc) then this can work well. –  CAD bloke Dec 4 '12 at 3:01
have a look under the .hg folder. hg-git creates a .git folder there unless you specify [git] intree = true in your .hgrc / ini file for mercurial. –  CAD bloke Dec 4 '12 at 3:03
add comment

I have used both mercurial and git on the same project, in the same working directory. The great thing about using these two DVCS's is that they both only have one folder (.git/.hg) for their confs and blobs and trees and stuff.

Just put .hg in .gitignore (and .git in .hgignore) and you are more than good to go.

You of course have to double the work when committing, but I didn't find this to hard to manage.

This setup in my opinion is far more reliable than using any bridge solutions (I don't like them since the horror I had with git-svn).

share|improve this answer
Can you give more info on how you achieved this? I have a question here stackoverflow.com/questions/14486600/… which seems to have been achieved by you. Any help is appreciated :) –  Kevin Jan 24 '13 at 9:48
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.