Subversion 将分支与移动的文件合并,并保留两者
我有一个分支项目,一堆文件(F1)被移动到不同的目录并更改(F2)。现在,我想将分支合并回主干并保留修订历史记录,但我想保留 F1 和 F2。有没有办法在颠覆中做到这一点?
I have a project which was branched, and a bunch of files (F1) were moved into a different directory and changed (F2). Now, I want to merge the branch back to Trunk and keep revision history, but I want to keep both F1 and F2. Is there a way to do this in subversion?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你问的问题对我来说听起来很矛盾。也许我只是不明白你在问什么。
如果您只想在需要时访问 F1,请在合并 F2 分支之前标记 F1。
如果将分支合并回主干,F2 文件将覆盖 F1 文件。这就是合并。
如果您想同时保留 F1 和 F2 文件,您可以将分支添加到主干并删除分支。这样,F1 和 F2 文件都可用。我将通过导出 F2 的工作副本、共享 F2 的工作副本并删除原始 F2 来完成此操作。
What you're asking sounds contradictory to me. Maybe I just don't understand what you're asking.
If you just want to access F1 if the need arises, tag F1 before you merge the F2 branch.
If you merge the branch back into the trunk, the F2 files will overlay the F1 files. That's what a merge is.
If you want to keep both the F1 and F2 files, you would add the branch to the trunk and delete the branch. That way, the F1 and F2 files would both be available. I would do this by exporting the working copy of F2, sharing the working copy of F2, and deleting the original F2.
我明白了这一点。
我需要检查最初分支的主干修订版。然后,我需要 SVN 将 F1 文件复制到各自的新目录,以便副本可能成为 F2。然后,合并分支中的一系列修订以使 F2 文件保持最新。最后,合并一系列修订以使 F1 文件保持最新状态。瞧!历史和一切都被保留,我得到了 F1 和 F2。
I figured this out.
I need to check out the trunk revision that was originally branched. Then, I need to SVN COPY the F1 files to their respective new directories so the copies may become F2. Then, merge in a range of revisions from the branch to bring the F2 files up to date. Last, merge in a range of revisions to bring the F1 files up to date. Voila! Histories and everything are preserved, and I get both F1 and F2.