gitvisual-studio-codemerge

How can I quit an in-progress git merge operation in VS Code?


I'm working on a project in VS code. I made changes, pulled from GitHub and got merge conflicts. I don't know what i did but my merge conflict screen now looks like this (it's highlighting the file as one big merge conflict?). I don't want to delete any of my progress in this file. Is there a way to "reset" (quit) the merge so I can try merging again?

enter image description here


Solution

  • Use the Git: Merge Abort command in the command palette. Its command ID is git.mergeAbort (you can use this to bind it to a keyboard shortcut). The command pretty much just does git merge --abort.

    Technically, just running git merge --abort in any terminal in that git repository should work too. It doesn't even have to be in VS Code's integrated terminal. VS Code's builtin Git extension watches for externally driven changes.