码迷,mamicode.com
首页 > 其他好文 > 详细

svn merge

时间:2014-10-09 00:40:47      阅读:289      评论:0      收藏:0      [点我收藏+]

标签:des   blog   http   io   os   使用   ar   for   strong   

这里针对1.7版本的svn。

merge是svn命令中比较麻烦的一个,所以特别记录一下。

下面链接有一个gui使用的例子:

http://blog.csdn.net/keda8997110/article/details/21813035

 

命令行的例子如下:

http://svnbook.red-bean.com/nightly/zh/svn.branchmerge.basicmerging.html#ftn.idp7707344

保持分支同步,从主干合并修改到分支:
$ pwd
/home/user/my-calc-branch

$ svn merge ^/calc/trunk
--- Merging r345 through r356 into ‘.‘:
U    button.c
U    integer.c
$
$ svn status
 M      .
M       button.c
M       integer.c
$
$ svn commit -m "Merged latest trunk changes to my-calc-branch."
Sending        .
Sending        button.c
Sending        integer.c
Transmitting file data ..
Committed revision 357.
$

 

重新集成分支,和并分支修改到主干:

$ pwd
/home/user/calc-trunk

$ svn update  # (make sure the working copy is up to date)
At revision 390.

$ svn merge --reintegrate ^/calc/branches/my-calc-branch
--- Merging differences between repository URLs into ‘.‘:
U    button.c
U    integer.c
U    Makefile
 U   .

$ # build, test, verify, ...

$ svn commit -m "Merge my-calc-branch back into trunk!"
Sending        .
Sending        button.c
Sending        integer.c
Sending        Makefile
Transmitting file data ..
Committed revision 391.
 
$ svn delete ^/calc/branches/my-calc-branch       -m "Remove my-calc-branch, reintegrated with trunk in r391."
Committed revision 392.
 
 

svn各个版本改进:

http://subversion.apache.org/docs/release-notes/1.5.html#merge-tracking

Merge tracking (foundational) (client and server)

Merging changes from (say) trunk to a branch no longer requires that you specify the revision range. Instead, each time you want to sync up with trunk, you can just do:

   $ cd BRANCH_WORKING_COPY
   $ svn merge URL_TO_TRUNK

Subversion will figure out what changes from URL_TO_TRUNK have not yet been merged and pull in just those changes. When it‘s time to merge the branch back to trunk, do this:

   $ cd TRUNK_WORKING_COPY
   $ svn merge --reintegrate URL_TO_BRANCH

 

http://subversion.apache.org/docs/release-notes/1.6.html#repository-root-relative-urls
Repository root relative URLs (client)

This section is currently incomplete, please help write it! See the design notes for more information.

   $ svn SUBCOMMAND ^/
   $ svn SUBCOMMAND ^/PATH

 

http://subversion.apache.org/docs/release-notes/1.8.html#auto-reintegrate
Automatic reintegration merge (--reintegrate option deprecated) ?

During merges which merge all eligible revisions from another branch, Subversion 1.8 will automatically decide whether or not the merge is reintegrating a branch. Therefore, reintegrating a branch does no longer require the --reintegrate option for correct operation.

The --reintegrate option of svn merge is now deprecated and its use is discouraged. To reintegrate a branch, have a clean working copy of trunk and run the following command in its top-level directory:

$ svn merge ^/branches/my-branch

svn merge

标签:des   blog   http   io   os   使用   ar   for   strong   

原文地址:http://www.cnblogs.com/cute/p/4011741.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!