Setup and Configuration Commands

git config

Description

The git config command is used to configure Git settings on a global or local project level. It allows to set user preferences and customize Git's behavior.

Usage

git config can be used to set, get, and list configuration variables that control aspects of Git’s operation and look. These variables can be stored at three different levels:

  1. System Level: Applies to every user on the system and all their repositories.

  2. Global Level: Applies to the current user and all their repositories.

  3. Local Level: Applies to the repository in the current working directory. This is the highest priority and overrides the same variables at the system or global level.

Basic Commands

Setting Configuration Variables

git config [--system | --global | --local] <key> <value>

-- Example
git config --global user.name "Your Name"
git config --global user.email "[email protected]"

Getting Configuration Variables

Listing Configuration Variables

Unsetting Configuration Variables

Common Configuration Options

Last updated