0

The below screenshot is from a rebase of one branch on top of another. There are a lot of conflicts like in the picture. They conflict, but if they were applied first one, then the other, they would apply cleanly.

Is there a way to tell IntelliJ "save what I have now and compare again"? Or is there maybe an entirely different and better way to do this, which I'm not seeing right now? Perhaps outside IntelliJ?

Screenshot from Intellij

drdeath
  • 81
  • 1
  • 11
  • 3
    I am sorry, but it's not quite clear what is your goal. > Is there a way to tell IntelliJ "save what I have now and compare again"? Why would you need this? What is the use case? – Ruslan Kuleshov Jun 22 '21 at 12:16
  • @Ruslan Now that I review it, it was a bad example. Sometimes git behaves really assy and sees conflicts where there aren't any. What I had in mind is, if I have a case where (unlike my stupid example) I could apply e.g. the left side, and be in a state where the right side applies cleanly, how do I get git to compare the file in it's new state to both incoming sides and see a non-conflicting incoming from the right? – drdeath Jun 30 '21 at 14:13

1 Answers1

0

IntelliJ is simply visualizing the information it gets from git. In this case, that means that git has found a conflict; left and right have both edited the same line and git cannot automatically merge them. You will have to do this manually either way, and IntelliJ is only trying to help you.

To keep both changes, first click the >> button on the left side (and watch IntelliJ insert the changes in the middle) and then click the << button on the right side (or the other way around, in whatever order you want the changes to be). You can also copy and paste from the left/right files to the middle file if you want to keep only part of the changes, and you can completely disregard them by clicking the x next to the << (or >>).

If you want to cancel the merge and try again, you can click the cancel button. You can then manually merge in your preferred merge tool or try to give IntelliJ another shot (the results will be the same however).

Abby
  • 1,610
  • 3
  • 19
  • 35