How to "Mark Resolved" a conflict in IntelliJ when using git?

Issue

IntelliJ (2021.3.1 in this case) has a tool – via right-click, Git, Resolve Conflicts... – which provides a three-pane yours/merged/theirs tool to fix conflicts.

However, I always find it much easier to fix the problems in situ, in the normal IDE edit pane, then flag that the conflicts are fixed.

Having done this though, how do you flag that the problems with the file in question are fixed?

When using IJ in the past with Subversion there was an option to just flag the file as fixed (right-click, Subversion, Mark Resolved – I think it was.)

Surely there must be a way to do the same when using git?

This seems like a really simple thing. But I’m now on my third Google attempt, and trawl through the IJ documentation, and nothing.

UPDATE:

To be clear, I don’t want to have to use the 3-pane Merge Revisions dialog at all. I want to edit the differences as shown in the regular edit window (as per below) and then flag the file as fixed when done. This used to be possible, at least with svn, though I suspect this might be a IJ version difference rather than specifically about svn vs git. The menu options to to Mark Resolved the current file just isn’t there any more.

e.g. I want to edit this directly in the IDE …

before
<<<<<<< HEAD
my changes
=======
their changes
>>>>>>> master
after

And when I’ve edited it to be…

before
my changes and their changes
after

… I just want to flag in IJ that I’ve fixed the conflict.

Solution

Just git add the file in question. Or use IntelliJ’s Add to VCS action on the file.

enter image description here

Answered By – michid

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published