Git config: Difference between revisions
Line 15: | Line 15: | ||
The configuration files are not replicated during [[git clone]]. | The configuration files are not replicated during [[git clone]]. | ||
=Configuration Operations= | =Configuration Operations= |
Revision as of 06:23, 25 November 2017
Internal
Overview
git config is used to manipulate entries in Git's configuration files. There are three levels of configuration files, listed below from the highest precedence to the lowest:
1. file (.git/config). This file contains repository-specific configuration and has the highest precedence. Repository-specific configuration is manipulated when git config is gets the "--file" option. This is the default.
2. global (~/.gitconfig). This file contains user-specific configuration and it is manipulated when git config gets the "--global" option.
3. system (/etc/gitconfig). This file contains system-wide configuration and can be manipulated with the "--system" option, if the user has proper permissions.
The configuration files are not replicated during git clone.
Configuration Operations
List the Configuration
git config -l
Configure a Setting
git config [--file|--global|--system] <some.git.option> <value>
Remove a Setting
git config --unset [--file|--global|--system] <some.git.option>