Convert a Mercurial Repository to Git

Run the following commands,

  • mkdir myrepo; cd myrepo;
  • git clone git://repo.or.cz/fast-export.git .
  • rm -rf .git .gitignore
  • git init
  • ./hg-fast-export.sh -r ../path/to/local/hg/repo
  • git clean -f # remove fast-export files