How to resolve git conflicts with only conflict files?

I had a very problematic git merge and my repo now has a bit of problems.

In fact, I have many files that look like this:

<<<<<<< HEAD
...version1...
=======
...version2...
>>>>>>> <long hexa code>

As we know, this is normal behavior in the event of merge conflicts. But I do not have other versions of the files, only them.

How can I combine this interactively? What I need is to see "version1" and "version2" next to each other and be able to combine them interactively.

Of course, this file format means a syntax error for each software.

git merge, and all merge tools say there is no merge conflict. But there is.

What should I do?

Extension # 1: I split the files using a bit of shellscripting, with the command

for i in $(cat ../conflicts); do csplit $i '/=======/' -f $i. -n 1;done

path.0 path.1. .

+4
2

git , , , .

, git reset HEAD, reset . , , , .

, node, node. git reset --hard HEAD^ reset ( ) . , ; .

+1

git mergetool, . , . ; :

git mergetool [--tool=<tool>] [-y | --[no-]prompt] [<file>...]

   -t <tool>, --tool=<tool>
       Use the merge resolution program specified by <tool>. Valid values include emerge, gvimdiff,
       kdiff3, meld, vimdiff, and tortoisemerge. Run git mergetool --tool-help for the list of
       valid <tool> settings. 
0

All Articles