I have asked Git to perform a commit from within git bash, It has brought up VI as it always does.
I now wish to cancel the commit, how do I prevent proceeding with the
To sum up:
git commit
) quit using :q!
.git commit --amend
) remove the commit message (only the first few rows not beginning with a #) for example by holding v and using arrow keys to select it and then pressing Delete. Quit with :wq
to apply changes! If you use :q!
the changes will be lost and the previous commit message will be used.When using VIM it's ok in both cases to quit with :cq
- VIM will quit with an error code and the commit will be aborted.