Search code examples
intellij-idea

Intellij show possible merge conflicts before actual merge


I have a file that was changed in one branch and renamed in another (but from comparison perspective it was deleted). I use IntelliJ for merging. When I merge the branch where the file was changed into the one where it was deleted, in the merge window the IntelliJ shows two panels one for the deleted file which is obviously empty and the other one for modified file with changes highlighted in darker pink.

I need to add these changes to my renamed file. And I can do it manually, np, however I cannot keep the merge/comparison window open. It must be closed before I can do any code modifications.

My question is: is there a way to get the same kind of comparison with possible merge conflicts highlighted before the actual merge.


Solution

  • IntelliJ relies on the command-line git and needs git to attempt the merge before it can show you the merge dialog. So, unfortunately, it is not possible to get the merge dialog without starting the merge.

    However, it seems that to solve the task you only need the merge dialog to be non-modal - here is the request for it in JetBrains tracker https://youtrack.jetbrains.com/issue/IDEA-66552