user.name and user.email
- Git course
- Beginner
- Lesson 14/80
- 4 min
Learn to set the name and email for commit authorship.
Commit author and identity
When developing a project with Git, every change must have an owner. Git records this information as the author and displays it in the change history.
git config user.name "Ahmet Yılmaz"To set the author name, you assign your full name in double quotes to the user.name key.
user.email and quotes
To complete the author identity, you must define an email address alongside the name. Double quotes are required if the value contains spaces, and are good practice even without spaces.
git config user.email "ahmet@example.com"This ensures Git associates every action you take with this name and email.
Practice Define an email address
Set the user.email setting to "ayse@example.com" and then print it with git config user.email.
Starter code
# user.email ayarını yap ve ekrana yazdırSample solution
git config user.email "ayse@example.com"
git config user.emailExpected output
ayse@example.com
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 Which command is used to set the commit author's email address in Git?
- git config set user.email "example@mail.com"
- git config user.email "example@mail.com" Correct answer
- git config email "example@mail.com"
- git config author.email "example@mail.com"
Explanation: In Git, the email address is configured via the `user.email` key.
2 Set email address
git config ____ "zeynep@example.com"
git config user.email "zeynep@example.com"
Explanation: The `user.email` key is used to set the author's email address.
3 Author configuration
| Term | Meaning |
|---|---|
user.name |
Author's display name |
user.email |
Author's email address |
Author |
Person making the change |
Tırnak işareti |
Preserves spaced text |