git: fatal: '--ours/--theirs' cannot be used with switching branches git: fatal: '--ours/--theirs' cannot be used with switching branches git git

git: fatal: '--ours/--theirs' cannot be used with switching branches


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)>


Well, you can use cherry-pick to clone everything from the branch marked --theirs to your current HEAD.

git cherry-pick <commit you want to copy>