remote: error: GH007: Your push would publish a private email address.remote: You can make your emai
! [remote rejected] master -> master (push declined due to email privacy restrictions)
前一阵闲着无聊给多设置了邮箱,码云和github上
后来出现了各种问题其中就有个是
remote: Resolving deltas: 100% (18/18), completed with 16 local objects.
remote: error: GH007: Your push would publish a private email address.
remote: You can make your email public or disable this protection by visiting:
remote: http://github.com/settings/emails
To https://github.com/Affee/GovernanceWater.git
! [remote rejected] master -> master (push declined due to email privacy restrictions)
While you can of course uncheck that setting, it will expose your private e-mail address to everyone in the world, as author information is readable by anyone with access to your repository.
Instead, do this:
-
You can see your personal e-mail address, which is used by default for your commits in Git:
git config --global user.email
-
Find your GitHub noreply address in your GitHub's Personal Settings → Emails. It's mentioned in the description of the Keep my email address private checkbox. Usually, it starts with a unique identifier, plus your username:
{ID}+{username}@users.noreply.github.com
-
Change the global user e-mail address setting to be your GitHub noreply address:
git config --global user.email {ID}+{username}@users.noreply.github.com
-
Reset the author information on your last commit:
git commit --amend --reset-author
If you have multiple commits with your private e-mail address, see this answer.
-
Now you can push the commit with the noreply e-mail address, and future commits will have the noreply e-mail address as well.
git push
主要原因就是git邮箱的修改 git log 查询下,是否跟自己的邮箱一致