How to "abort" merge in IntelliJ Idea
Happened to me while getting both push and pull failures:
- "Push to origin/master was rejected"
- "You have not concluded your merge (MERGE_HEAD exists). Please, commit your changes before you can merge"
To resolve:
- Go to "Version Control" window --> "Log" tab.
- Right click the previous commit --> "Reset Current Branch to Here..."
- In Git reset select "Mixed" (it keeps local changes).
- If there are later commits that were already pushed --> Pull from remote and merge as required.
- Commit the new changes, and Push to remote.
In the latest versions of IntelliJ (and I suppose other JetBrains products) there is a new option in the "Git branches" menu (bottom right of the screen) conveniently named "Abort Merge"...