When I use git commit --amend
or git rebase -i
, vim opens up for me to make changes. If I then change my mind and exit vim without making any changes, a commit is still made which shows up in git reflog
.
How do I exit the editor without committing anything?
:cq!
This will force an error to Vim and it will not save any changes. Link to Vim manual.
You may want to use cq
without !
if you want vim
to exit with an error and without saving.