Resolving a 'both added' merge conflict in git?

后端 未结 3 1543
北恋
北恋 2020-12-04 07:48

I\'m rebasing in git, and one conflict I get is \'both added\' - that is, exactly the same filename has been added independently in my branch, and in the branch I\'m rebasin

3条回答
  •  执念已碎
    2020-12-04 08:09

    If you use git rm git will remove all versions of that path from the index so your resolve action will leave you without either version.

    You can use git checkout --ours src/MyFile.cs to choose the version from the branch onto which you are rebasing or git checkout --theirs src/MyFile.cs to choose the version from the branch which you are rebasing.

    If you want a blend you need to use a merge tool or edit it manually.

提交回复
热议问题