The cursor blinked like a heartbeat, and nothing moved. You typed git reset and suddenly, the screen filled with text inside Vim. You didn’t expect an editor. You just wanted to undo a commit.
This happens because git reset with certain options can drop you into the default editor for commit messages, which might be Vim if you never changed it. If you don’t use Vim daily, you may freeze. But you don’t have to.
Why git reset Opens Vim
When you run git reset --soft HEAD~1 or similar, Git sometimes opens the editor to let you update a commit message. Vim is the default editor on many systems. If your Git config doesn’t point elsewhere, that’s what you get.
How to Exit Vim During a git reset
If you don’t want to edit, type:
:q!
and press Enter. This quits without saving.
If you want to save changes:
:wq
and press Enter.
Avoiding Vim in the Future
Set another editor as your Git default:
git config --global core.editor "nano"
or
git config --global core.editor "code --wait"
This prevents git reset from firing up Vim again unless you choose it.
Quick Basics If You Stay in Vim
- Insert mode: press
i - Back to command mode: press
Esc - Save and quit:
:wq - Quit without saving:
:q!
Understanding git reset
git reset moves the HEAD pointer.
--soft: keeps changes staged.--mixed: unstages changes but leaves files. (default)--hard: discards changes fully.
If you run it with --soft and --edit, expect Git to pop open the commit message in the editor.
Workflow Without Interruptions
A clean Git workflow means momentum. Small friction points like unexpected Vim launches cost time. Configure your tools so they work the way you think, not the other way around.
Want to see developer workflows without these slowdowns? Check out hoop.dev and run it live in minutes.