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.

2 Answers
2

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.

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 blokeDec 4 '12 at 3:01

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).