Make git merge result in conflict when both versions have the same change

Let's say in the git repository I have a file containing version information:

version=42

Now, if on two separate branches the version increases by

version=43

and these branches are merged, the standard git merge mechanism will not lead to a merge conflict, since both versions are the same (even if the merge base is different).

This is usually the desired behavior, but in the case of this file I want to get a merge conflict when both branches are different from the merge base. Is there any merge strategy that always ends with a merge conflict when a row is edited in both branches (even if they are the same)?

+4
source share
1 answer

. , , Git, Git, , , , . git read-tree ( ) , git read-tree, , - .

.

+3

Source: https://habr.com/ru/post/1690772/


All Articles