Mercurial:将文件集合移动到不相关的存储库
我有一堆文件,它实际上是 ac# 项目和与之相关的文件,整个 hg 存储库是一个包含许多项目的解决方案。 我需要将这些(有历史记录)移动到另一个现有的存储库。
最好的方法是什么?
I have a bunch of files, its actually a c# project and the files related to it, the whole hg repository is a solution with many projects.
I need to move those (with history) to another existing repository .
What is the best way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设您有 A 和 B 存储库。您的目标是提取 A 中的“a”文件夹并将其与 B 合并以生成 B_with_a,同时保留历史记录。
1) 提取A中的'a'并生成Aa。您可以使用 hg Convert 来做到这一点:
~$ hg 转换 A Aa --filemap list.txt
其中 list.txt 是
包括一个
2) 将 Aa 拉到 B - 使 B_with_a_yet_merged。您必须使用 -f 因为它们不相关。
<代码>
〜/ B $ hg拉./../Aa -f
3) 合并 B_with_a_yet_merged 中的两个分支,使 B_with_a
~/B$ hg 合并(最后一次在 Aa 中)
PS
。
不要忘记事先备份A和B!当我第一次这样做时,我把存储库弄乱了三遍。
Say, you have A and B repositories. Your goal is to extract an 'a' folder in A and merge it with B to make B_with_a, while preserving histories.
1) Extract 'a' in A and make Aa. You can do this with hg convert:
~$ hg convert A Aa --filemap list.txt
where list.txt is
include a
2) Pull Aa to B - to make B_with_a_yet_merged. You have to use -f since they are not related.
~/B$ hg pull ./../Aa -f
3) Merge two branches in B_with_a_yet_merged to make B_with_a
~/B$ hg merge (with the last rev in Aa)
PS.
Don't forget to backup A and B beforehand! When I first did this, I messed up repositories three times.
在浏览了 hg 命令后,我发现了捆绑包,似乎已经成功了。更多详细信息很快
更新:尝试过这个但没有成功。当我解开它时,它带来了文件,并且我能够合并,但由于某种原因,图表关闭了。
我只是想我发帖是为了完整性
After a poke around hg commands I found bundle, seemed to have made the trick. More details soon
Update: tried this and didnt work. It brought the files when I unbundled it, and I was able to merge, but for some reason the graph was off.
I just thought I d post for completeness