When and why would you use git config command?
git config command is used for managing git configuration settings.
- All configuration settings are stored in a text file .gitconfig.
- The file consist of sections and key-value pairs where each key defines one property and value defines its value.
- There are multiple levels of configuration - System/Global/Local
Important configuration settings
- user.name - defines user name that will be used as an identifier of the person who committed the changes (Author)
- user.email - defines e-mail of a person who committed the changes (Author) - this e-mail will be visible in list of commits.
- core.editor - defines path to custom file editor
- System - configuration settings from this level are used across all user acounts on the computer.
- Global - configuration settings from this level are used for all repositories within a useraccount
- Local - configuration settings from this level are used for one repository only.
The configuration settings are inherited fromt he highest level (System) to the lowest level (Local). Each configuration setting can be overridden on the lower level.
There is one .gitconfig file for each configuration level, each file is stored in different location depending on the operating system and level