Sometimes you need to keep working on old projects that may use outdated version control systems, such as Mercurial or, God forbid, SVN. Fortunately, to move from Mercurial to Git you do not need to start the project from a clean slate and lose the history of changes; there is a utility that will do everything for us by itself.
cd
git clone git://repo.or.cz/fast-export.git
git init git_repo
cd ~/git_repo
~/fast-export/hg-fast-export.sh -r ~/mercurial-repo
git checkout HEAD
As a result, in the current folder we will get a real Git repository.