Let's say I have a file with this content in master
:
Line 1
Line 2
Line 3
Line 4
Now say I create and checkout a new branch called test
. In this branch I change the file to this:
Line 1
Line 2
Line 3 Modified
Line 4
and I commit this and switch back to master
. In master I change the file to:
Line 1
Line 2
Line 3
Line 4 Modified
and I commit. Now if I merge branch test
into master
, I get a conflict.
Why can't git auto resolve this, using the common ancestor? If I tell git to edit conflicts using BeyondCompare as the difftool, BeyondCompare autoresolves this without even telling the user, since this isn't a real conflict. Is there a way to get git to autoresolve these? I've tried the recursive
and resolve
merge strategies but neither do it.
It's an issue in our company because there are certain files where multiple developers change lines in close proximity and this causes many unnecessary conflicts when they pull.