EN
Git - how to show username and email?
10
points
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:
- Open command line, e.g. Git Bash,
- 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:
- Open command line, e.g. Git Bash,
- Change directory into specific repository directory,
e.g.cd /path/to/reporitory
, - 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.