0

The Situation

The primary files our team works with are binary files from Git's perspective. When merging, if the two branches have the same file with any differences, there will always be a merge conflict. Every time. Which basically means we will have a conflict in 90%+ of our merges.

Most of the time we just want to merge the new version (typically the branch merging in, for example, a feature branch merging into dev), but not always.

Considerations

I realize it's not horribly difficult to use the command-line to resolve this, but I want the simplest method possible as this is confusing for new team members and those who do this irregularly, and we are going to have to do it almost every time we merge.

We could setup .gitattributes to auto-merge binaries with a given extension, but this will always choose either the new (theirs) or the old (ours), there isn't an option. Again you could fix the exceptions with a command-line process (no auto-commit, checkout from the "other" branch not auto-merged, add and commit), but the goal here is a simple, unambiguous process with the least chance for human error.

Questions

When you run git mergetool for txt file conflicts, it directly asks you whether to use the entire new file, the entire old file, or to launch the configured merge tool to resolve it.

  1. This process would be perfect for binary files as well - is there anyway to get mergetool to just ask this same question on binaries?

  2. Or, is there some tool available that will load the binary and then allow for the same function (i.e. select the entire new or old file)?

LightCC
  • 9,804
  • 5
  • 52
  • 92
  • "same file with any differences", can you clarify what you mean here? – Lasse V. Karlsen Jun 27 '19 at 15:56
  • @LasseVågsætherKarlsen If you make any change at all to a binary file, git can't autoresolve it. So if I touch a binary file at all in a branch that is merging, it will be considered a merge conflict for that file. – LightCC Jun 27 '19 at 16:03

0 Answers0