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.
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.
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.
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.
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.