In a merge with conflicts, is there a way to tell git to keep one version for a set of files?
$ git checkout some_branch
$ git merge origin/master
$ ?
Merge conflicts happen when you merge branches that have competing commits, and Git needs your help to decide which changes to incorporate in the final merge. Git can often resolve differences between branches and merge them automatically.
If you've already attempted the merge and are looking at the unmerged files, you can use git checkout:
git checkout some_branch git merge origin/master <conflicts!> git checkout --theirs -- <dir>|<file>
(and of course, --ours
keeps the version from the current branch)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With