Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vi Error while making git commit

I am attempting to make a git commit. I run the command git commit and vim opens up. I type in my commit message, and when I execute the :wq command, I get the following error:

error: There was a problem with the editor 'vi'. Please supply the message using either -m or -F option.

Any idea how I can figure out what the problem is?

like image 896
Jackson Avatar asked Mar 13 '23 20:03

Jackson


2 Answers

To fix this problem change your git editor path

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

SOURCE

like image 130
Mr Rubix Avatar answered Mar 15 '23 10:03

Mr Rubix


If you want to recover the commit message, you can look in .git/COMMIT_EDITMSG.

This file contains the commit message of a commit in progress. If git commit exits due to an error before creating a commit, any commit message that has been provided by the user (e.g., in an editor session) will be available in this file, but will be overwritten by the next invocation of git commit.

like image 30
Heath Borders Avatar answered Mar 15 '23 09:03

Heath Borders