我没有使用Mercurial的丰富经验,我主要是个Git爱好者。
我想在git库中镜像一个特定的Mercurial文件夹/文件。我实际上想要做的是将文件的历史记录从Mercurial存储库中导出到Git中,并且能够与将来的提交保持同步。
你对如何进行有什么建议吗?我认为应该这样做:获取Mercurial补丁的历史记录,定期将每个提交导出为补丁,并将Mercurial补丁应用到Git存储库。
发布于 2015-03-26 02:21:52
Gitify
似乎是执行转换https://github.com/buchuki/gitifyhg的一种更现代、更易于使用的替代方案
pip install gitifyhg
git clone gitifyhg::<hgrepoaddress>
# done, you have a git repo with the entire history of the hg one
发布于 2020-01-22 23:01:24
也许它对今天的某些人有帮助(在将mercurial存储库转换为git时,同时保留历史记录)。经测试可与mercurial 4.0.1配合使用。
~$ git clone https://*old_hg_repo*
~$ git clone https://github.com/frej/fast-export.git
~$ cd fast-export
~$ git checkout tags/v180317
~$ cd ..
~$ mkdir new_git_repo
~$ cd new_git_repo
~$ git init
~$ .../fast-export/hg-fast-export.sh -r ../old_hg_repo/ --force
~$ git checkout HEAD
最后,推送新转换的本地存储库。
~$ git push REMOTE '*:*'
https://stackoverflow.com/questions/10710250
复制相似问题