Git

How do I Show my Global Git Configuration?

Git is a decentralized version control system that can store source code/files, and the related content can be accessed either locally or remotely. The Git repositories are managed by the Hosting service known as GitHub. Different flags are used to manipulate configuration files, such as the “global” flag with the “$ git config” command can be used to edit the configuration, such as username, email, credentials, and recent repository by issuing the Git config command.

This guide discusses the different commands to show global Git configurations.

How do I Show my Global Git Configuration?

Multiple commands are available to show the global Git configurations, such as:

  • The “$ git config –global –list” command is used to display the list of configurations.
  • To view the user name, the “$ git config –global –get user.name” command can be utilized.
  • The “$ git config –global –get user.email” command is used to view the user email.
  • The “$ git config –global credential.helper” command is used to show the credentials.
  • The “$ git config –global gui.recentrepo” command can be utilized to view the recent repository.

Now, let’s utilize the stated commands!

Step 1: Launch Git Terminal

First, search and launch the Git terminal on your system using the Startup menu:

Step 2: List Global Git Configuration

Execute the “git config –global” command with the “–list” option to view the list of global Git configurations:

$ git config --global --list

As you can see, the below output displayed the whole list of my global Git configuration:

How to Show my Global Git Configuration User Email?

To show the global Git configuration user email, execute the “git config –global –get” command and specify “user.email” as the property value you want to get:

$ git config --global --get user.email

It can be observed that we have successfully fetched the configured email id:

How to Show my Global Git Configuration User Name?

To display the global Git configuration user name, the “git config –global –get” command with the “user.name” can be utilized:

$ git config --global --get user.name

As you can see, the global Git configured user name is displayed:

How to Show my Global Git Configuration Credential?

To show the global Git configuration credential, use the “git config” command with the “credential.helper”:

$ git config --global credential.helper

How to Show my Global Git Configuration Recent Repository?

To show the global Git configuration recent repository, the “git config” command can be used along with the “gui.recentrepo” option:

$ git config --global gui.recentrepo

According to the below output, “Linuxhint” is our recent repository:

That’s it! We have compiled the different commands to show global Git configurations.

Conclusion

Several commands are available to show the global Git configurations, such as the “$ git config –global –list” command that can display the list of configurations. To display the user name and user email, the “$ git config –global –get user.name” and “$ git config –global –get user.email” commands are used. To show the credentials, the “$ git config –global credential.helper” command is utilized to show the credentials. The “$ git config –global gui.recentrepo” command can be utilized to view the recent repository. This guide determined the different commands to show global Git configurations.

About the author

Maria Naz

I hold a master's degree in computer science. I am passionate about my work, exploring new technologies, learning programming languages, and I love to share my knowledge with the world.