There are three levels of configuration in git:

  1. System

    Values defined at this level will apply to all users.
    The values are stored in /etc/gitconfig

  2. Global

    Values defined at the global level will be valid for all repositories belonging to a specific user
    The values are stored in ~/.gitconfig

  3. Local

    Local configuration is valid for a specific repository
    Values are stored in .git/config within the main directory of the repository

To set a specific value, use the following syntax:

git config [--system|--global|--local] property value

For example, to set the user name property globally to ‘Hari Seldon’:

git config --global user.name "Hari Seldon"
Share!