All the configurations related to git such as the user.email and user.name are stored in the gitconfig files that can be stored at different places based on the option you provided (system, global, local) while setting them up,
- $PATH/etc/gitconfig: Stores the system config values, which are set using --sytem option
- ~/.gitconfig: Stores the personal/global values which are set using --global option.
- .git/config: Stores values at the local repository level, set using the --local option.
You can see all the config values using the command: git config -l or git config --list
Example:% git config -l
user.env=uat
user.email=you@example.com
user.name=Code2care
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
user.team=dev
In order to see the file location of all the config values add the option --show-origin
Example:git config --list --show-origin
file:/etc/gitconfig user.env=uat
file:/root/.gitconfig user.email=you@example.com
file:/root/.gitconfig user.name=Code2care
file:.git/config core.repositoryformatversion=0
file:.git/config core.filemode=true
file:.git/config core.bare=false
file:.git/config core.logallrefupdates=true
file:.git/config user.team=dev
More Posts related to Git,
- Change the default git branch name from master to main
- [Fixed] Git Clone git@github.com: Permission denied (publickey) Could not read from remote repository Fatal error
- [Solution] fatal: not a git repository (or any of the parent directories): .git
- [fix] zsh: command not found: git
- How to Install Git on Windows
- Setup Git + Visual Studio Code Tutorial
- How to undo last Git Commit on Local Repository?
- Install GitHub Command Line Tool on Mac
- How to Create a Git Branch in 6 Different ways
- Fix Git: Warning: could not find UI helper GitHub.UI on Windows
- Git Config Command - A Deep Dive
- Step-by-Step: How to delete a git branch from local as well as remote origin
- How to Add Git Bash Option to Windows Terminal List
- Command to Clone Repository Using Git Bash
- How to remove or unstage a file from git staged area
- Get the file location of git config values
- GitHub: How to Search Code
- How to check your installed version of Git
- Fix: error: src refspec master does not match any failed to push some refs to Git
- Git: Step-by-Step - How to Push Local Brach to GitHub
- How to Merge Branch into Master Branch
- fix fatal: --local can only be used inside a git repository error
- Fix: Git Pull Error: unable to resolve reference refs/remotes/origin/master: reference broken
- Change the default diff or commit editor for git
- Git Fix: fatal: refusing to merge unrelated histories Error
More Posts:
- How to create alias in macOS - MacOS
- Sharepoint Server 2016 installation Prerequisites with download links - SharePoint
- Multiple ways to Convert tabs with spaces in Notepad++ - NotepadPlusPlus
- How to Auto Fill Down in Excel for Mac - MacOS
- Save webpage as pdf in Google Chrome for Mac OS X - Mac-OS-X
- Nano Undo/Redo Keyboard Shortcuts - Linux
- How to Save Jupyter Notebook as PDF - Python
- Mac: How to Open Android Studio from Terminal - MacOS