SVN:将本地更改合并到其他工作副本中 [英] SVN: merge local changes into other working copy
问题描述
我有同一项目的两个工作副本,每个副本都切换到不同的分支.是否可以将一个项目中的本地更改合并到另一个工作副本中?
I have two working copies of the same project, each switched to a different branch. Is it possible to merge local changes in one project to the other working copy?
推荐答案
您不能合并两个单独的工作副本,但是可以做一些事情.
You can't merge two separate working copies, but there are some things you can do.
如果对现有文件进行了更改,最简单的方法是使用svn diff
创建补丁,然后将该补丁应用于其他工作副本.例如.在第一个工作副本中,您执行以下操作:
If the changes are made to existing files, the easiest way is to create a patch with svn diff
, and then just apply that patch to the other working copy. Eg. in the first working copy you do:
svn diff > patch
然后将其应用于另一个:
And then you apply it in the other one:
patch -p0 < patch
和往常一样,您要使用--dry-run
选项运行patch
,以确保它首先运行.
And as usual you want to run patch
with the --dry-run
option to make sure it works first.
但是,如果分支的文件布局不同,则不能仅获取补丁并应用它.在这种情况下,您只需要做的就是先提交其他本地更改,然后照常使用svn merge
However if the branches don't have the same file layout, then you can't just take a patch and apply it. In this case what you need to do is simply just first commit the other local changes, and then use svn merge
as usual
这篇关于SVN:将本地更改合并到其他工作副本中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!