Subversion - 合并跳过重复文件名而不恢复
如果这个问题得到解答,我深表歉意,但在决定发布此内容之前,我仔细阅读了一堆文章。
所以我有一个分支和主干,我正在尝试合并。
/树干/废话 /branch/Blah/FeatureA
因此,我在分支中创建一个文件“test.txt”并提交它。 然后我不小心在主干中创建了一个文件“test.txt”
后来我尝试将功能A分支合并到主干。
它给了我错误
Skipped 'Test.txt'
Summary of conflicts:
Skipped paths: 1
合并时
。所以我意识到这是因为主干有一个无意义的文件副本。我从主干中删除该文件并重新运行合并命令,它给了我零输出。
如果我使用 --dry-run 运行合并,它也不会返回任何输出
如果我使用相同的参数运行 diff 命令,它会显示文件 Test.txt 并打算添加。
所以我跑出去再次进行测试,但这次使用“test2.txt”。我确保主干没有名为“test2.txt”的文件。我运行了合并并且运行得很完美。
所以我的问题是,当我不小心在主干中有一个同名的文件时会导致冲突。
我如何让 subversion
- 引发冲突并询问我是否要替换或编辑冲突
- 允许我重命名/删除文件,以便我可以简单地重新运行合并并且它可以工作
谢谢!
** 编辑 - 有答案 **
我有第二双眼睛,显然我忽略了在合并命令上添加 --ignore-ancestry 标志。一旦我添加了它,一切就完美了
Apologies if this is answered, but I waded through a bunch of articles before I decided to post this.
So I have a branch and the main trunk and I was experimenting with Merging.
/trunk/Blah
/branch/Blah/FeatureA
So I create a file "test.txt" in the branch and commited it.
I then accidentally created a file "test.txt" in the trunk
Later I attempt to merge the feature A branch to the main trunk.
It gives me the error
Skipped 'Test.txt'
Summary of conflicts:
Skipped paths: 1
When merging.
So I realize it's because the main trunk had a non-sensical copy of the file. I delete the file from the trunk and re-run the merge command and it gives me zero output.
If I run the merge with the --dry-run, it too returns no output
If I run the diff command with the same arguments it shows the file Test.txt and that it intends to add.
So I ran off and did the test again but this time with "test2.txt". I made sure that the trunk didn't have a file named "test2.txt". I ran the merge and it ran perfectly.
So my question is, when I do accidentally have a file in the trunk with the same name that causes a conflict.
How do I get subversion to
- Raise a conflict and ask me if it wants to replace or edit the conflict
- Allow me to rename/delete the file so that I can simply re-run the merge and it works
Thanks!
** EDIT - With Answer **
I had a second set of eyes, apparently I neglected to add the --ignore-ancestry flag on my merge command. Once I added that, everything worked perfectly
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这种冲突就是树冲突。
解决冲突的唯一方法是从主干或分支中选择文件。
合并期间没有帮助程序重命名,您必须手动解决此冲突。
This kind of conflict is a tree conflict.
The only way to resolve the conflict is to choose a file from either trunk or branch.
There is not helper to rename during merge, you must manually solve this conflict.
我有第二双眼睛,显然我忽略了在合并命令中添加 --ignore-ancestry 标志。一旦我添加了它,一切就完美了
I had a second set of eyes, apparently I neglected to add the --ignore-ancestry flag on my merge command. Once I added that, everything worked perfectly