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?
You can 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
. Courtesy of feature-request #152525.
Just running git merge --abort
in any terminal in that git repository should work too because it's the underlying operation of the command palette command. It doesn't even have to be in VS Code's integrated terminal. VS Code's builtin Git extension watches for externally driven changes.
None of these suggestions worked for me. I did run git merge --abort
from the command line, but there was no evidence of whether it worked or not.
I couldn't get anything useful to show up in the command palette.
I tried quitting VSCode, but it just dumped me back into the same horrible Merge Compare view.
Finally, I realized I could just close the file, close the merge view, and start over.
This is a terrible UX if you're trying to do refactoring across multiple branches - it only seemed to give me the option to accept all incoming changes, not pick and choose.
Anyway hopefully this helps someone else - you'd think there would be an easy way to get in and out of any kind of view, i.e. hit escape, or command-z to undo, but I couldn't figure out how to cancel out of this view without being stuck with changes I didn't want to save.
git status
. or see the answers in https://mcmap.net/q/545305/-git-determine-if-branch-is-in-a-merge-conflict-state/11107541 –
Superstratum © 2022 - 2024 — McMap. All rights reserved.
git status
to see what git expects you to do – Oof