svn merge

这里针对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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值