Skip to content

Instantly share code, notes, and snippets.

@kanelv
Created June 29, 2023 13:37
Show Gist options
  • Save kanelv/3f2712815033d7f23c2facd7c8592c1d to your computer and use it in GitHub Desktop.
Save kanelv/3f2712815033d7f23c2facd7c8592c1d to your computer and use it in GitHub Desktop.
Git Config Command

Git Config Command

  • ~/.gitconfig file stores git global config
  • .git/config file local configuration will be in your repository's

The command below will show the combination information of the 2 files above

git config --list
git config --list --global
git config --list --local
git config --list --system
# To see setting is defined (global, user, repo, etc...) and where it is
git config --list --show-origin

notice: You can look at the effective config in a repository and I can differ local, global and system config with the appropriate parameter (--global, --local, --system)

To edit config

# Global level
git config --global user.name "John Doe"
git config --global user.email johndoe@example.com

# Repository level
git config --local user.name "John Doe"
git config --local user.email johndoe@example.com

Refs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment