In a merge conflict, I'm trying to resolve all the merge conflicts in favour of a particular branch.
I'm trying to do git checkout --ours
, but I get the following error:
fatal: '--ours/--theirs' cannot be used with switching branches
How can I achieve what I'm trying to do?
Using git checkout
with --ours
or --theirs
expects at least one argument: the path(s) of the files / directories to checkout.
As the manual says:
When checking out paths from the index, check out stage #2 (ours) or #3 (theirs) for unmerged paths.
So:
git checkout --ours <path(s)>
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