Git

Where is the Global Git Config Data Stored?

Git has different scopes to set the configuration data, such as global, local, and system Git config scopes. They override each other based on the performed operations. The global Git config scope overrides the system Git config. Similarly, the local Git config scope overrides the global Git config scope. The global Git config is specific to the user’s operating system.

This article will demonstrate:

How to Find the Location of Global Git Config Data Using Commands?

To find the location of global Git config data, execute the “git config –list –show-origin –show-scope” command in the terminal. To do so, look at the following steps.

First, execute the “cd” command along with the Git root directory path and redirect to it:

$ cd "C:\Git"

Then, execute the following command:

$ git config --list --show-origin --show-scope

The below output displays the global Git config data is stored in “file:C: /Users/Laiba/.gitconfig” location:

How to Find the Location of Global Git Config Data Manually?

You can also manually find the location of global Git config data with the help of the provided path:

C:\Users\\.gitconfig

Note: This is the general path and works for every Windows system:

That’s it! We have explained the methods to find the location of global Git config data.

Conclusion

To find the location of global Git config data, first, open the Git bash terminal. Then, redirect to the local Git repository and execute the “git config –list –show-origin –show-scope” command. Another way to find the stored data location is by utilizing the “C:\Users\username\.gitconfig” path on your PC. This article demonstrated the possible ways to find the location of global Git config data using commands and manually.

About the author

Sharqa Hameed

I am a Linux enthusiast, I love to read Every Linux blog on the internet. I hold masters degree in computer science and am passionate about learning and teaching.