My issue is I have changed a file eg: README, added a new line \'this for my testing line\' and saved the file, then I issued the following commands
gi
If you're in the middle of a commit (i.e. in your editor already), you can cancel it by deleting all lines above the first #
. That will abort the commit.
So you can delete all lines so that the commit message is empty, then save the file:
You'll then get a message that says Aborting commit due to empty commit message.
.
EDIT:
You can also delete all the lines and the result will be exactly the same.
To delete all lines in vim (if that is your default editor), once you're in the editor, type gg
to go to the first line, then dG
to delete all lines. Finally, write and quit the file with wq
and your commit will be aborted.