Set your Git username and email #
The Git protocol stores username and email information with commits you make. This is separate from your GitHub credentials.
Set your username #
The Git username is displayed beside each commit.
Although it’s possible to set any username, using your GitHub username will make troubleshooting much easier.
- Open the terminal with
Terminal
❯New Terminal
. - Set your username by entering
git config --global user.name "MaxHeadroom"
, substituting your own username. - Confirm your username by entering
git config --global user.name
.
- Open Git Bash from your applications.
- Set your username by entering
git config --global user.name "MaxHeadroom"
, substituting your own username. - Confirm your username by entering
git config --global user.name
.
Set your email #
The Git email address is used to link commits to your GitHub account.
GitHub provides a private email address for commits if you wish to keep your personal email private.
- Sign into GitHub.
- From the user menu at the top right, select
Settings
.- Select
Emails
.- Scroll to
Keep my email addresses private
, then copy your private address. It looks something like: [email protected].
- Open the terminal with
Terminal
❯New Terminal
. - Set your email by entering
git config --global user.email "[email protected]"
, substituting your own email. - Confirm your email by entering
git config --global user.email
.
- Open Git Bash from your applications.
- Set your email by entering
git config --global user.email "[email protected]"
, substituting your own email. - Confirm your email by entering
git config --global user.email
.