Although I am inclined to agree that the scenario you described may indicate that you have more serious problems with the development process, git can be made so that you can easily cope by setting the attribute mergein the file in the question to one of two values. From the “Performing a Three-Way Merger” section, git help attributesthey:
merge unset
, . , .
, :
echo "composer.json -merge" >> .gitattributes
merge=binary
, .
, :
echo "composer.json merge=binary" >> .gitattributes
, , , , :
$ git merge develop
warning: Cannot merge binary files: composer.json (HEAD vs. develop)
Auto-merging composer.json
CONFLICT (content): Merge conflict in composer.json
Automatic merge failed; fix conflicts and then commit the result.
$ git status
On branch attr-test-2
You have unmerged paths.
(fix conflicts and run "git commit")
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: composer.json
no changes added to commit (use "git add" and/or "git commit -a")
, , , , git , -merge .