When I make a new Git commit (git commit) and it enters Vim, sometimes it happens that I make a small typo when I want to save the commit-message-file. E.g. I type :Wq instead of the usual :wq.

Vim reports an error then. Then, when I correctly save the file and quit Vim, Git says that Vim reported an error and it aborts the commit.

How can I avoid that? I.e. how can I reset the Vim error state so that Git doesn't think that Vim had an error?


Are you running OSX? maybe that will help. It seems you have to call vim which its full path. Just add it to your config git config --global core.editor /usr/bin/vim

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.