使用 Subversion 合并两个分支修订

我想合并所有的变化之间发生的转速10和头转速的 http://url-of-branch-a和应用他们到 http://url-of-branch-b

比如..。

svn merge -r 10:HEAD http://url-of-branch-a

这可能吗? 如果可能,语法是什么?

我在 unix 命令行中运行 SVN 客户机,SVN 客户机版本是1.4

编辑: 是的,我的具体解决方案是..。

  1. 将目录更改为要接收更改的工作副本的位置(分支 -b)
  2. Svn merge-r 10: HEAD http://url-of-branch-a

这将把从‘ Branch-a’到‘ Branch-b’的更改合并到一起

91924 次浏览

Checkout URL A. Use SVN merge to merge URL B to your working copy of A. Commit A.

Or vice versa of course :)

The process is as follows:

  1. Establish a working copy of branch B (svn checkout http://branch-b)
  2. Merge changes from branch A into working copy of B (svn merge -r 10:HEAD http://branch-a .)
  3. Commit (after resolving conflicts) working copy B to branch b (svn commit)

Check the man page (help file) for svn merge semantics. It shows you that svn merge always dumps the results into a working copy.

Check out the SVNBook for all the details.

Mostly confuse merge by trying to do in svn repo, we can not directly merge to svn repo, we can merge to working copy of local machine as follows:

  • This working copy should be destination URL of merge(i.e. checkout destination).

  • merge working copy with source URL of merge.

  • commit to destination.

Best Practice : Merge In , Merge Out.