Whether you’re a beginner or a seasoned developer, understanding how Git is configured on your machine is key to a smooth and predictable development workflow. Git uses a set of configuration files to determine user identity, editor preferences, aliases, remotes, and more.
In this blog post, you’ll learn how to view your current Git configuration using the git config --list
command and how to understand what the output means.
β
What Is git config
?
git config
is the command used to get and set Git configuration values. These settings control the behavior of Git across your system, a specific repository, or your user profile.
Configurations are stored in three different scopes:
- System (
--system
): applies to every user on the machine. - Global (
--global
): applies to your user profile. - Local (default): applies only to the current Git repository.
π How to Show Git Configuration
To view all the Git configuration settings currently in use, run:
git config --list
This command lists all the effective Git configuration values from system, global, and local scopes, in order of priority (local > global > system).
Example Output:
user.name=Jane Developer
user.email=ja**@ex*****.com
core.editor=code --wait
color.ui=auto
alias.co=checkout
credential.helper=cache
π§© What the Output Means
Each line follows the format:
key=value
Hereβs what some of the common keys mean:
Key | Description |
---|---|
user.name | The name Git will use in commits |
user.email | The email associated with commits |
core.editor | The default text editor for Git |
alias.co | A Git alias (e.g., git co for git checkout ) |
credential.helper | How Git stores your credentials |
π― Show Config by Scope
You can also view settings by scope:
β€ Global Configuration:
git config --global --list
β€ System Configuration:
git config --system --list
β€ Local (Repository-Level) Configuration:
git config --local --list
β οΈ To view
--system
config, you may need administrator privileges depending on your OS.
π Advanced: View a Specific Config Value
If you want to check a single setting, use:
git config user.name
Or specify the scope:
git config --global user.email
π§Ή Troubleshooting Conflicting Settings
If the same key exists in multiple scopes, Git will use the one with the highest precedence:
Local > Global > System
To override a setting:
git config --global user.name "New Name"
To remove a setting:
git config --global --unset user.name
β Summary
Task | Command |
---|---|
Show all config | git config --list |
Show global config | git config --global --list |
Show local config | git config --local --list |
View one value | git config user.name |
Unset a config | git config --global --unset user.name |
π Final Thoughts
Understanding your Git configuration is essential for using Git effectively. With git config --list
, you can quickly audit how Git is set up, debug issues, or fine-tune your development environment.