Summary
To set your user name for Git, enter the following command in your terminal:
git config --global user.name "Your Name"
To set your email for Git, enter the following command in your terminal:
git config --global user.email youremail@example.com
Details
If you need to change your user name or email, you can use the same commands from above. Replace “Your Name” with your actual name and youremail@example.com with your actual email address.
To check your list of settings, including your user name and email, enter the following command in your terminal:
git config --list
You should see something similar to the following print out in your terminal:
credential.helper=osxkeychain
filter.lfs.required=true
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
user.name=John Smith
user.email=john.smith@simpledev.io
Exercises
Use the commands from the summary to set your username and email address for Git. Use git config --list
to check that they were set correctly.
References
First-Time Git Setup from the Pro Git book