1

We are checking in binary files into git. The problem is git does not shows conflicts/changes while merging. It just accepts the file and overwrites it even there are conflicts. I am not sure whether git understands binary files or not. Please help and provide suggestions.

Note: Binary files are generated from our own tool.

1 Answers1

1

If the binary files are generated, they should not be put in the git repo in the first place.

When merging, there will be a conflict only if the binary file has been update in both branches (the source and the destination branches of the merge). In that case, as shown in "Resolving a Git conflict with binary files", there will be a conflict.

If the binary file has been updated only in the source branch, then it will overwrite the same file in the destination branch of the merge.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Hello Vonc, I have my own jar to read that binary file. Is there any way to utilize the jar and show conflict before merge. Mainly can i write any plugin to understand the binary file using my jar? – Karthikeyan V Jul 21 '15 at 06:57
  • @KarthikeyanV for testing a merge: http://stackoverflow.com/q/6335717/6309 and http://stackoverflow.com/q/501407/6309. For example `git merge --no-commit --no-ff $BRANCH` – VonC Jul 21 '15 at 07:02
  • @KarthikeyanV generally, binaries are not merged (http://stackoverflow.com/a/2920807/6309) – VonC Jul 21 '15 at 07:02
  • Thanks a lot. Your comments were very helpful. – Karthikeyan V Jul 22 '15 at 04:52