Safeguarding code against merge conflicts

No, that won't work, and it might make things worse.

When Git performs a merge, it considers exactly three points: the two heads (branches) you're merging, and a third point, called the merge base, which is usually the most recent common ancestor. When the merge occurs, if one side has a change and the other does not, then Git adopts the side with the change. If both sides have changes in the same area, then a merge conflict occurs.

In your case, if you and your colleague both make the same changes, then Git will adopt that as the result, the same as if only one of you made the changes. However, it could happen that if you both make the same changes (by copying data from one branch to the other) and one of you also works nearby on other changes, then a conflict occurs unnecessarily because the context of the two regions unexpectedly overlaps.

If you were going to make changes to the same line or lines very close by anyway, then you'll have a conflict, no matter what, so one of you is going to have to resolve it anyway. It's better to just rely on the normal merge machinery to do the right thing.