Default text editor for git

Default text editor for git #

Some git commands open a text editor to let you type a message. By default, on most systems, this editor is vi, which is not friendly to new users.

Instead, we recommend configuring git so that it opens your favorite text editor. The command is:

git config --global core.editor <myEditor>

where <myEditor> is the command that launches your text editor. For instance:

  • notepad for Notepad++ (Windows),
  • "open -e -W -n" for TextEdit (macOS),
  • gedit for gedit,
  • sublime for sublime text,
  • etc.