且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将Mercurial存储库转换为Git

更新时间:2023-11-11 20:54:52

在我的Mac上完成了以下操作,以成功将Mercurial存储库导出到Git(包含完整分支):

  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#删除快速导出文件


I've already tried hg2git through fast-export and I've already tried hg-git.

Both with no success. hg2git actually worked, but I had to ask a friend who runs a Unix machine to do it. And that messed up all the linefeeds throughout the files.

hg-git simply failed with some libzip compression error.

Has anyone had any success converting a hg repo to git on Windows?

To be clear, I don't care about interop. I want to port the whole repo from hg to git, taking the history with me. I don't need to push changes back and forth - only convert once.

Thanks in advance!

Did the following on my Mac to successfully export a Mercurial repo to Git (with full branches):

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