Configure Other Editors

If you don’t want to use vi to craft your commit messages, deal with rebases, or other aspects of Git, you’re in luck. Changing your default editor is pretty simple. Just follow the instructions below:

Changing core.editor

To change the default editor that git uses, you can use the git config core.editor setting. Every text editor is assigned to the core.editor setting differently, but thankfully there is a GitHub Help article about how to associate a specific editor as your default editor. Using the Atom text editor as an example it would look something like this:

  1. Make sure your terminal application is closed.
  2. Install Atom.
  3. Enter the following in your terminal application: git config --global core.editor "atom --wait".

In some instances, you will need to use the installation path of Atom when setting the config settings.

Tell me why

Why –global?

Git allows you to set configuration options at three different levels.

  • --system These are system-wide configurations. They apply to all users on this computer.
  • --global These are the user level configurations. They only apply to your user account and will be applied to every repository you create or clone under your account.
  • --local - These are the repository level configurations. They only apply to the specific repository where they are set.

The default value for git config is --local. --local has precedence so setting something at the local level will override settings at global or system level.