Git commit -a opens GNU nano 2.2.6 How should I change it to open Vim instead?

Ketan Deshmukh picture Ketan Deshmukh · Oct 30, 2013 · Viewed 10.8k times · Source

I am trying to add a commit message to my changes using

git commit -a 

OR just plain

git commit

this somehow opens GNU Nano 2.2.6 editor and I am not at all comfortable with it. So the question is :

How can I modify my settings so that it always opens with VIM ?

What I already have done is inserting following line in my ~/.bash_profile

set EDITOR = vim

Please help !

Answer

StevenPatz picture StevenPatz · Oct 30, 2013

You can set it from the command line or in your .gitconfig

git config --global core.editor vim