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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.