Writing a commit message in GIT is an essential part of leveraging version control. The default editor in GIT is the popular VIM. What if your not a huge fan of VIM? Perhaps you have not had the chance to learn VIM and for now you would like to stick with another editor such as PICO or NANO.
No worries, changing GIT's default editor is super easy. We will show you how to do it in 3 steps:
- View your config settings in GIT with this command:
git config --list
That should print out all of your GIT specific configuration settings.
If you were successful in getting the command to work then you may have noticed this line:core.editor=vim
This setting is what we need to change. - Set the editor to our desired preference by running this command:
git config --global core.editor "pico"
Notice the editor name in double quotes! - Re-run the list command to verify:
git config --list
If you can see:core.editor=pico
you are all set!
Reference: Stack Overflow