How to Use git config –list to Show Your Git Configuration

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:

KeyDescription
user.nameThe name Git will use in commits
user.emailThe email associated with commits
core.editorThe default text editor for Git
alias.coA Git alias (e.g., git co for git checkout)
credential.helperHow 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

TaskCommand
Show all configgit config --list
Show global configgit config --global --list
Show local configgit config --local --list
View one valuegit config user.name
Unset a configgit 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.

Sharing Is Caring:

Leave a Comment