How to change your Git editor

When you create a Git commit with git commit –a, the default editor that will be opened is Vim. This can be very confusing for people, as Vim is not an easy editor if you have never worked with it previously.

Luckily, Git allows you to change the editor that gets opened by default very easily!

There are two ways in which this can be done. The first is via the terminal; this is useful if you want your editor to be Nano, for example. The command to do this is git config --global core.editor "nano". You can change the highlighted section with your editor of choice!

Another way to do this is to edit the .gitconfig file in your home directory. The location of this file depends on the operating system you're using. The possible ...

Get GitLab Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.