如何将分支与所有提交历史记录合并回SVN中的主干?
如何将分支与所有提交历史记录合并回SVN中的主干?我知道我可以在Git中使用
How to merge branch back to trunk in SVN with all commit history? I know in Git I can use
merge -squash
SVN中是否有任何等效命令?我正在使用SVN 1.6.
Is there any equivalent command in SVN? I am using SVN 1.6.
在Subversion 1.5或更高版本中,合并记录在svn:mergeinfo属性的本地工作副本中.因此,此信息不会丢失.
With Subversion 1.5 or later the merge is recorded on your local working copy in the svn:mergeinfo property. So this information is not lost.
如果使用svn log -g
而不是常规的svn log
,则可以看到合并的修订.
You can see the merged revisions if you use svn log -g
instead of the normal svn log
.
正常合并的执行方式
svn merge -rREV1:REV2 svn://server/branch my_trunk_wc
但是,如果您使用分支,则使用重新集成合并有时会更方便.在这种情况下,您应该首先使用类似
But if you use a branch it is sometimes more convenient to use a reintegration merge. In this case you should first merge all trunk changes to the branch using something like
svn merge svn://server/trunk my_branch_wc
(这将合并所有尚未合并的内容)
(This merges everything that is not already merged)
将更改提交到分支后,您可以使用
And after you commit this change to the branch you can use
svn merge --reintegrate svn://server/branch my_trunk_wc
将所有更改作为一次提交移动. (执行此操作后,应删除该分支)
To move all changes over as a single commit. (After this operation you should remove the branch)