Git on Mac: How to set Nano as the default text editor?

Solution 1:

git config --global core.editor "nano"

More information here:

https://git-scm.com/book/en/Customizing-Git-Git-Configuration

Solution 2:

If you want to use nano as your editor for all things command line, add this to your bash_profile:

export EDITOR=/usr/bin/nano

This is assuming you're using the system nano. If not, edit to suit where your nano lives (e.g. /usr/local/bin, /opt/local/bin)

Remember to source your bash_profile after setting this or open a new terminal window for the settings to work...