Languages
[Edit]
EN

Git - how to show username and email?

10 points
Created by:
Root-ssh
175400

In this article, we would like to answer for the question: how to show username and email fot current configuration in Git.

Quick solution:

# shows username
git config user.name

# shows email
git config user.email

Hint: check section 2 and 3 to see difference between global and single repositiory configuration.

 

1. Overview

Depending on where and what command we run, we can get:

  • global configuration,
  • local configuration (single repository configuration).

The same Git configuration works under Windows, Linux and macOS.

 

2. Global username and email configuration

Simple steps:

  1. Open command line, e.g. Git Bash,
  2. Show username and email by typing:
    # shows username
    git config --global user.name
    
    # shows email
    git config --global user.email

Note: it returns always global configuration.

 

3. Local username and email configuration (current single repository)

Simple steps:

  1. Open command line, e.g. Git Bash,
  2. Change directory into specific repository directory,
    e.g. cd /path/to/reporitory,
  3. Show username and email by typing:
    # shows username
    git config user.name
    
    # shows email
    git config user.email

Note: it returns always global configuration outside repository directory and local configuration inside repository directory.

 

See also

  1. Git - how to set username and email?

References

  1. Git config - Docs
  2. Getting Started - First-Time Git Setup
  3. Github - Setting your commit email address
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Git

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join