How to prevent changes from changing when merging branches?

I am new to Git (from Subversion and Bazaar).

When I worked on a branch and made a commit, and since then the owner has had some commits, when I merge my branch into a master, I find some strange events:

  • In my commit and commit wizard, we created a new file with the same path. He decides to completely override the main file with my file without warning of a conflict!
  • A previously existing file that has been modified in both branches gives me a conflict warning, and inline comments are added for some parts, but for other parts it is actually overwritten without warning.

Can I tell Git to be more strict with these conflicts? I do not want him to overwrite the files without warning, and if he would comment on the files for me to check, I would prefer that he provide absolute comments from all the differences.

If not, I am forced to identify files that have been modified by myself, and then manually merge them.

+3
source share
1 answer

When I try your first script, I get the following output:

Auto-merging conflicted
CONFLICT (add/add): Merge conflict in <filename>

The second scenario will result in conflicts in lines that differ between the two versions, but not in lines that were changed only in one or the other version. This is the expected behavior.

Git , VCS. - , . , . , , . , . , , . , , , , .

+2

All Articles