Automatically delete conflict markers

What is a quick way to remove conflict markers from source code?

I just merged some changes and now I have a lot of files in conflict.

I started manually deleting them. However, this will take too much time.

Is there a way git can automate this?

I just want to keep all the HEADs and drop all the others.

<<<<<<< HEAD
.
.
.
.
=======
.
.
.
.
>>>>>>> ffa5c899d36e779c23cff8b33f48f2ab95ef08c8
+3
source share
3 answers

This post will be useful to you: How to use my changes to merge in git?

I think you want: git merge otherbranch -s recursive -X ours

+5
source

It looks like you are trying to resolve conflicts manually, not git mergetool.

StackOverflow has many pooling tools, for example:

Conflict resolution is a fairly broad topic.

Some common practices:

  • local check version (restore changes)

    git reset -- filename

  • remote check version (change override)

    git checkout ORIG_HEAD -- filename

See also:

+2
source

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


All Articles