简体   繁体   中英

SVN resolve tree conflict in merge

I have an SVN merge tree conflict that i can't figure out how to resolve and i'm hoping you guys(girls) can help out.

Here's the situation: i created a branch A from trunk to do some development. Then i created a branch B, from branch A. Both branches are evolving concurrently.

At some point i cherry-picked some revisions from branch B into trunk to get some features developed in branch B.

Now, i synced branch A with trunk:

~/branch_a$ svn merge ^/trunk
~/branch_a$ svn commit

No problems here. Next step is to sync B with A:

~/branch_b$ svn merge ^/trunk

Here i get some tree conflicts, in files/dirs that already existed in trunk before the merge but were changed in the cherry-picks i did earlier (don't know if it has anything to do with it, i'm just mentioning it):

  C some_dir/other_dir/some_file.php
  >   local add, incoming add upon merge
  C some_other_dir/some_sub_dir
  >   local add, incoming add upon merge

Essentially i want the versions of the files that are coming in from the merge and discard the current version. What's the best way to solve this?

Thanks in advance!

Here's a site where you can find a well explained answer to how to do a merge.

http://www.sepcot.com/blog/2007/04/SVN-Merge-Branch-Trunk

When you use the merge without -r parameter you are trying to merge the entire branch included those revisions that not correspond exclusively to the branch i. What it really does is : it takes from the revision where you created the repository to the revision where you are actually now, and that includes the revision where this branch didn't exists yet, provoking, potentially, a lot of tree merging conflict and conflicts in generals.

When you are merging a branch to the trunk in svn you must specify the revision from the branch you want to pick, starting at the point where you make the copy that create the branch to the head revision of the trunk.

使用下面的命令它将解决您的树冲突

svn resolve --accept working -R <file name with path>

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