0

From local, I replace new pdf and jpg files. When I git push, it said "merge failed ... conflict".

How can I replace the new pdf and jpg files, and git push to the remote. I have so many pdf and jpg files at the local to replace.

I saw this to merge a single binary file. How can I merge multiple files at once?

Community
  • 1
  • 1
chipbk10
  • 5,783
  • 12
  • 49
  • 85

1 Answers1

1

In the case of binary files, the common sense approach is to pick one or the other; as opposed to really merging them (you don't want half-baked, corrupted files).

The link you provided gave you most of the answer already.

Just go a little further:

git checkout --theirs Path/*.pdf Path/*.jpg
git add Path/*.pdf Path/*.jpg
git commit -m "Resolved merge conflict by checking out file from [their branch] and adding it to the [current branch]"

Git should let you use wildcard expressions, and, multiple expressions.

Alterntatively, instead of --thiers, you might choose --ours.

starlocke
  • 3,407
  • 2
  • 25
  • 38
  • That is up to you to decide. Just do it and see which file you prefer. Alternatively, just replace it from another source altogether (ie: a new copy, with changes never committed to git), then follow up starting at ```git add``` – starlocke Jan 21 '16 at 18:28