简体   繁体   中英

merging old branch created in svn using git

We had an old svn repository that was migrated to git. Before migration we had created a branches in svn that were also migrated. The problem is that when we checkout the old svn branch the files are located under /trunk-folder and our master branch has the files in repository root folder. For example /trunk/subfolder/source.cs and /subfolder/source.cs. I tried moving files in then svn branch to root folder but when I try merge to master-branch I get bunch of "both-added" conflicts even when the files in both branches are identical. Is there any way to merge these branches without manually solving each conflict ?

To merge the old_branch into master and resolve the merge conflicts automatically, you can use -X options for git merge command.

  • git merge old_branch -X ours will resolve the merge conflicts automatically by keeping the version on master branch.
  • git merge old_branch -X theirs will resolve the merge conflicts automatically by keeping the version on the old_branch .

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