Push declined due to email pri
Error in pushing local repository to github:
Exception information:
! [remote rejected] master -> master (push declined due to email privacy restrictions)
Abnormal cause:
When configuring git, the author mailbox information is set, triggering Github privacy protection settings:
Block command line pushes that expose my email
Solution:
Close Block command line pushes that expose my email option:
A lot of people choose to turn off the email option in GitHub; Block command line pushes that expose my email ; rude but not recommended.
Personal recommendations:
Change the email address for git configuration:
If you don't want to close the above settings, you can solve it by modifying Email:
1. Use the command to view the current global user Email: git config --global user.email2, Find your GitHub recommendation Email: Under setting--> Email --> keep my Email private, select Email; Format: id+username@users.noreply.github.com3. Reset your global user Email: git config --global user.email "Recommended Email from GitHub"4. Reset the author information of the last submission git commit --amend --reset-author Enter the command and enter vi mode (git default editor); Unfamiliar, can be directly in English input method:wq(colon wq) save 5, submit git push
If there are no other problems, we are done.