简体   繁体   中英

svn: how to copy changes from one feature branch to another

I'm currently working on two svn branches, one called A and one called B. Branch A is mostly done and almost ready to merge into the base branch. Branch B is new, and I want to pull in some work from branch A to B since I added some useful infrastructure. I tried a simple merge of A into B, which seemed to work ( svn merge ^/branches/A . ). However, at a later stage, when A was merged back into the base branch, I tried merging the base branch into B and got a ton of tree conflicts because the files are being added again. How should I have done the prior merge to avoid this problem?

 . A created    . A merged (all is well)
-------------------------------> Base Branch
 |          |   |                               
 -----------|---- Branch A   
            |                
            -------------------> Branch B
            ^  ^             ^
  B created |  |             | merged base into B, explosions occur
               |
               | merged A into B (svn merge ^/branches/A .)

You need to svn merge --record-only the revision which is a result of merge of A into base, it is the one confusing the svn . Then try the original merge again. Instead of doing A->base it is better to do it like base->a->base, in which case merge conflicts are resolved on A, not on base and you could have merged that result up to B too without problems.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM