View your global Git configuration

List global settings, trace configuration values to their source and scope, and account for includes, worktree settings, and command-level overrides.

Best practices
Illustration of Git branches and version history

Run git config --global --list to list the global configuration files Git reads for your account. To inspect values from all scopes in the current repository, include their origins and scopes:

git config --global --list
git config --list --show-origin --show-scope

The full list can contain repeated keys; it is not a deduplicated table of one final value per setting. Some keys are multivalued, so their interpretation depends on the setting.

Query a particular setting

git config --show-origin --get user.email
git config --get-all remote.origin.fetch
git config --get-regexp '^user[.]'

A missing setting can produce no output and a nonzero exit status. Use --get-all when multiple values are meaningful rather than assuming one returned value tells the whole story.

Global files and includes

Common global files are ~/.gitconfig and $XDG_CONFIG_HOME/git/config, with ~/.config/git/config used when XDG_CONFIG_HOME is unset or empty. Reading only ~/.gitconfig may miss other global settings. On Windows, Git resolves the user's home directory as well; use origin output instead of guessing one absolute path.

When a scope such as --global is specified, includes are not followed by default. To include those settings explicitly:

git config --global --includes --list --show-origin

Conditional includes can depend on the repository or branch, so run the query in the context you are investigating.

Understand precedence

For ordinary single-valued settings, later/higher-priority values override earlier ones. The usual scope order is system, global, repository-local, worktree when enabled, and command scope. Command scope includes git -c key=value ... and supported environment-based configuration.

Scope Typical source
System Installation-specific system Git configuration
Global User configuration files and applicable includes
Local Repository configuration
Worktree Worktree configuration when enabled
Command Per-invocation configuration

Environment variables specific to a feature, such as GIT_EDITOR, may have their own precedence beyond a particular config key.

FAQ

Why did changing my global value have no effect?

Inspect git config --show-origin --show-scope --get KEY from the affected repository. A local, worktree, command, or feature-specific environment setting may take precedence.

Should name and email be global?

A global default is convenient. Override identity locally or with conditional includes when work and personal projects require different identities.

How do I remove an incorrect value?

Use git config --global --unset KEY for a single value, or --unset-all when you deliberately want all values of that key removed from that scope. Inspect includes and origins before editing the wrong file.

See git-config.

Get a tailored plan

Contact us

Join the community

Scan with WeChat
to join the community

Try Guance

Start online and pay only for what you use.

Get started

Choose a Guance plan

Code hosting