Security of your personal email address on GitHub
π‘To keep your personal email address secure using GitHub you should do some configurations before starting with git.
When you push commits from the command line, the email address that you've set in Git is associated with your commits, so, you should do some configurations to keep your personal email address secure. You can execute git config
command to change the email address associated with your commits.
1.- Log in to your account on GitHub. In the upper-right corner of any page, click your profile photo, then click Settings, click on the tab "Emails" and copy the email address assigned by GitHub. This email is in the red box of the image.
2.- Setting your Git username for every repository on your computer. Then set your Git username in the terminal with the command git config --global user.name "<username>"
:
$ git config --global user.name "Cristina Ramirez"
3.- Confirm that you have set the Git username correctly:
$ git config --global user.name
4.- Open Terminal. Set the email address assigned by GitHub using git config --global user.email <github_email>
command. This new email address will be used in git operations and not your personal email address.
git config --global user.email <github_email@users.noreply.github.com>
5.- Confirm that you have set the email address correctly in Git executing git config user.email
command.
git config user.email
Reference:
https://docs.github.com/en/get-started/getting-started-with-git/setting-your-username-in-git