Configuration in git

Git configuration is stored at 3 levels.
  • System – These settings apply to all Git repositories created by all users of the system. On windows, you might find system config file at C:\ProgramData\Git. On Linux machine, System config file is located at /etc/gitconfig.
  • User (Global) – These settings apply to all Git repositories created by specific user. This file is located at user home directory. Sometimes it is available at user home directory (on network).
  • Local – These settings apply to single repository.
Below commands are used to view various Git settings.
  • git config –system –list
  • git config –global –list
  • git config –local –list
  • git config -l
Below commands are used to edit various Git settings.
  • git config –system –edit
  • git config –global –edit
  • git config –local –edit
If you do not like typing the commands, you can directly open these files in text editor to view and edit them. Below images show sample output of above commands.
Complex problems, Simple Solutions