将Mercurial文件夹转换为Git存储库 [英] Converting Mercurial folder to a Git repository

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

问题描述



我很想在一个特定的Mercurial文件夹/文件中镜像git存储库。我实际上想要做的是将文件的历史记录从Mercurial存储库导出到Git,并能够保持与未来提交同步。



你有什么建议如何进行?我相信要走的路应该是获取Mercurial补丁的历史记录,定期将每个提交作为补丁导出,并将Mercurial补丁应用于Git存储库。

解决方案

请尝试快速导出

  cd 
git clone git://repo.or.cz/fast-export.git
git init git_repo
cd git_repo
〜/ fast-export / hg-fast-export.sh -r / path / to / old / mercurial_repo
git checkout HEAD


I don't have a huge experience with Mercurial, I'm mostly a Git guy.

I would love to mirror a specific Mercurial folder/file in a git Repository. What I'm actually trying to do is to export the history of a file from a Mercurial repository to Git and being able to keep this in sync with future commits.

Do you have any suggestion on how to proceed? I believe that the way to go should be to get the history of the Mercurial patch, periodically export every single commit as a patch and apply the Mercurial patches to the Git repository.

解决方案

Try with fast export:

cd
git clone git://repo.or.cz/fast-export.git
git init git_repo
cd git_repo
~/fast-export/hg-fast-export.sh -r /path/to/old/mercurial_repo
git checkout HEAD

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

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