Show Global Git Config & Location |Video upload date:  · Duration: PT2M52S  · Language: EN

Quick guide to view global Git config and find the global config file path on Linux Mac or Windows with commands to inspect and edit settings

If you ever opened a repo and Git behaved like a confused oracle you did not consult, this quick guide will show you where your user level git settings live and how to tell which file is winning the argument. We will use simple git commands that are safe and explain what the output means. This is useful for identity fixes, editor preferences, and stopping mysterious newline behavior.

List global settings with one command

Want the short answer fast and without drama Use this to see keys like user.name and user.email

git config --global --list

The command prints key value pairs from the global file unless a repo local override exists. If you see something you do not expect this command tells you the current effective user level values.

Show file origins so you can blame a file instead of your keyboard

When a setting will not go away use the show origin option to see which file supplies each entry

git config --list --show-origin

The output gives file paths next to each key value pair. Typical sources you will see are the system config the global user config and the repository config. That makes it obvious if the value comes from /etc/gitconfig or from ~/.gitconfig or from .git/config in the repo.

Why this matters

  • If a repo has a local config it overrides the user level setting. That is expected behavior and not personal.
  • Seeing origins helps when a setting feels stubborn. If you change the global file and nothing happens check the repo local file first.
  • System level config can surprise you on shared machines or CI runners.

Edit the global config file safely

To open your user level gitconfig in your default editor run this command

git config --global --edit

On Unix like systems the global file typically lives at ~/.gitconfig. On Windows look in the user profile path such as %USERPROFILE%/.gitconfig. Make small edits and be aware that global changes affect all repositories for your user account.

Practical tips and common pitfalls

  • Use repository local settings for one off rules and use global settings for identity and common preferences. Think global for your name and email think local for per project hooks or weird merges.
  • When confused run the show origin command before editing files. It is faster than regret.
  • Backup your global config file before large edits. A simple copy will save future you from staring at unexplained commit name changes.
  • Remember that some GUIs and tools write settings to different levels. If something keeps reverting check all levels with the show origin command.

Quick summary

Run git config --global --list to view user level values. Run git config --list --show-origin to trace which file supplies each entry. Run git config --global --edit to change your user level config file. These three commands will solve most mysteries involving gitconfig and save you from yelling at your terminal.

If you want a last tip here it is Make conservative global edits and prefer repo level overrides when the change should not apply everywhere. You are welcome.

I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!

This is a dedicated watch page for a single video.