EN
Git - how to set username and email?
2 points
Usually we configure global username and email address after installing Git.
We can also set configuration for single specific repository.
In this post we cover both configurations:
- global (all repositories)
- single repository
Git configuration works the same under Windows, Linux and macOS.
- Open command line (eg git bash)
- Set your username:
xxxxxxxxxx
1git config --global user.name "FIRST_NAME LAST_NAME"
- Set your email address:
xxxxxxxxxx
1git config --global user.email "OUR_NAME@example.com"
- Verify your configuration by showing username and email
xxxxxxxxxx
1# show username
2git config user.name
3# show email
4git config user.email
- Open command line (eg git bash) and change directory into specific repository
- Set your username:
xxxxxxxxxx
1git config user.name "FIRST_NAME LAST_NAME"
- Set your email address:
xxxxxxxxxx
1git config user.email "OUR_NAME@example.com"
- Verify your configuration by showing username and email
xxxxxxxxxx
1# show username
2git config user.name
3# show email
4git config user.email