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:
xxxxxxxxxx
1
# shows username
2
git config user.name
3
4
# shows email
5
git config user.email
Hint: check section 2 and 3 to see difference between global and single repositiory configuration.
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.
Simple steps:
- Open command line, e.g. Git Bash,
- Show username and email by typing:
xxxxxxxxxx
1# shows username
2git config --global user.name
3
4# shows email
5git config --global user.email
Note: it returns always global configuration.
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:
xxxxxxxxxx
1# shows username
2git config user.name
3
4# shows email
5git config user.email
Note: it returns always global configuration outside repository directory and local configuration inside repository directory.