Subversion - 合并跳过重复文件名而不恢复

发布于 2024-12-08 05:46:10 字数 802 浏览 0 评论 0原文

如果这个问题得到解答,我深表歉意,但在决定发布此内容之前,我仔细阅读了一堆文章。

所以我有一个分支和主干,我正在尝试合并。

/树干/废话 /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

  1. 引发冲突并询问我是否要替换或编辑冲突
  2. 允许我重命名/删除文件,以便我可以简单地重新运行合并并且它可以工作

谢谢!

** 编辑 - 有答案 **

我有第二双眼睛,显然我忽略了在合并命令上添加 --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

  1. Raise a conflict and ask me if it wants to replace or edit the conflict
  2. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

锦上情书 2024-12-15 05:46:10

这种冲突就是树冲突
解决冲突的唯一方法是从主干或分支中选择文件。
合并期间没有帮助程序重命名,您必须手动解决此冲突。

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.

ゞ记忆︶ㄣ 2024-12-15 05:46:10

我有第二双眼睛,显然我忽略了在合并命令中添加 --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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文