error: There was a problem with the editor 'vi' when using it with git

vi is existing with a non-zero status, although without additional details about your setup, it's difficult to tell why. If you're using a lot of plugins to vim, you might try moving your .vimrc file to .vimrc.back and seeing if you can replicate. There are a few sources that discuss this problem, including at least one with a potential solution:

git config --global core.editor /usr/bin/vim

I would try removing your .vimrc first, however. It seems to cause more consternation.


As answered here: https://stackoverflow.com/questions/22699614/git-commit-messages-lost-by-vi

The real solution is to

git config --global core.editor vim -f

According to vim documentation - -f option should be used when Vim is executed by a program that will wait for the edit session to finish