将Mercurial存储库转换为Git [英] Convert a Mercurial Repository to Git

查看:101
本文介绍了将Mercurial存储库转换为Git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过快速导出尝试了hg2git,并且已经尝试过hg-git。

两者都没有成功。 hg2git实际上工作,但我不得不问一个运行Unix机器的朋友去做。这使整个文件中的所有换行都搞砸了。

hg-git仅仅因为一些libzip压缩错误而失败。



有没有人在Windows上将hg repo转换为git?



不关心互操作。我想把整个回购从hg转移到git,并带走我的历史。

预先致谢!

解决方案

在我的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

这篇关于将Mercurial存储库转换为Git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆