将 Mercurial 文件夹转换为 Git 存储库

2024-04-02

我对 Mercurial 没有丰富的经验,我主要是一个 Git 爱好者。

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

您对如何进行有什么建议吗?我认为,正确的方法应该是获取 Mercurial 补丁的历史记录,定期将每个提交导出为补丁,并将 Mercurial 补丁应用到 Git 存储库。


On Linux或任何与bash/sh或类似的,或python, 尝试用快速导出 https://github.com/frej/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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

将 Mercurial 文件夹转换为 Git 存储库 的相关文章

随机推荐