logo

How to Set Git Username and Email 📂Programing

How to Set Git Username and Email

Guide

git config --global user.name "Your Name"
git config --global user.email "Your Email"

It may seem obvious, but many actions that use Git require a GitHub username and email. If you configure them once as above, it’s convenient because you won’t need to set them again on the same machine.

Issue

alt text

In fact, there are countless posts introducing git config, and the true purpose of this post is to solve cases where GitHub does not recognize the correct account even though the username was entered correctly as above.

Troubleshooting

alt text

From experience, the problem is often an incorrectly entered email. Check which email you actually registered in your GitHub account’s Settings → Emails. It’s best to enter the email that is set as Primary.