How to manage a Git merge conflict with xlsx (binary)?
It requested to fix the conflict:
$ git merge
warning: Cannot merge binary files: proj/data/specs.xlsx (HEAD vs.
refs/remotes/origin/master)
Auto-merging proj/data/specs.xlsx
CONFLICT (content): Merge conflict in proj/data/specs.xlsx
Automatic merge failed; fix conflicts and then commit the result.
I want get the origin/master version of the file
git add proj/data/specs.xlsx; git commit
it keep my local version of the file.
If I checkout the file I get this error:
$ git checkout labor_um/data/UM_specs.xlsx
error: path 'labor_um/data/UM_specs.xlsx' is unmerged
Do:
git checkout --theirs proj/data/specs.xlsx
git add proj/data/specs.xlsx
git commit
The --theirs flag for the checkout command tells Git to use the version from the branch you are merging (in this case origin/master). Similarly, the --ours flag would use the version from the branch you are on (likely master).
Note that the definition of --theirs and --ours is swapped during a rebase.
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