gandolf gandolf - 11 months ago 73
Git Question

Convert Mercurial project to Git

I need to convert a mercurial project to a git project, but I would like to keep the commit history intact. My current solution was to just remove hg related files and then git init && add manually the files I needed, but that would not keep the history. Are there any solutions to this?

Answer Source

You can try using fast-export:

cd ~
git clone git://
git init git_repo
cd git_repo
~/fast-export/ -r /path/to/old/mercurial_repo
git checkout HEAD

Also have a look at this SO question.