Book Image

Git Best Practices Guide

By : PIDOUX Eric
Book Image

Git Best Practices Guide

By: PIDOUX Eric

Overview of this book

Table of Contents (12 chapters)

Customizing Git


As you already know, when you install Git, you have to configure your username and e-mail, but this isn't the only one configuration you can do:

Erik@server~:$ git config --global user.name 'Erik'
Erik@server~:$ git config --global user.email '[email protected]'

Git uses a series of configuration files to perform various activities. First, Git checks the /etc/gitconfig file that contains configurations for every user.

Then, Git looks in ~/.gitconfig, which is specific to each user. Finally, Git checks the .git/config file inside the repository.

There are a lot of options available, but we will cover only the commonly used. You can see a list of all options executing this:

Erik@server~:$ git config -help

You will find a lot of options to play with, but here are the most important ones:

  • Editor: You can use editors such as Emacs, Vi, nano, and so on. The following example shows how to use your favorite editor:

    Erik@server~:$ git config --global core.editor nano
    
  • Commit template...