Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Ground Controller Lvl 1
Message 11 of 19

Re: push declined due to email privacy restrictions

This is the perfect solution.

Copilot Lvl 2
Message 12 of 19

Re: push declined due to email privacy restrictions

This was EXACTLY what I needed. I couldn't figure out why nothing was being pushed. As soon as I unchecked that box, everything wents smoothly. Thank you!

Ground Controller Lvl 1
Message 13 of 19

Re: push declined due to email privacy restrictions

This is actually the answer. I don't know why the other was marked as the answer?

Copilot Lvl 2
Message 14 of 19

Re: push declined due to email privacy restrictions

Thanks It Worked for me


@nicks9188 wrote:

Just need to remove one checkbox as described here:

 

https://stackoverflow.com/questions/43378060/meaning-of-the-github-message-push-declined-due-to-emai...

 

This is likely caused by a new GitHub setting that blocks command line pushes that expose your email address.

Try unchecking the "Block command line pushes that expose my email" box in your email settingsand then pushing again.


 

Copilot Lvl 2
Message 15 of 19

Re: push declined due to email privacy restrictions

Works for me, thnx


@nicks9188 wrote:

Just need to remove one checkbox as described here:

 

https://stackoverflow.com/questions/43378060/meaning-of-the-github-message-push-declined-due-to-emai...

 

This is likely caused by a new GitHub setting that blocks command line pushes that expose your email address.

Try unchecking the "Block command line pushes that expose my email" box in your email settingsand then pushing again.


 

Ground Controller Lvl 1
Message 16 of 19

Re: push declined due to email privacy restrictions

In my case what happened was that I changed my email policy to be private and then git generates a new one to be used by me. I should setup this new email in my local machine:

 

git config --global user.email "rjesususa@users.noreply.github.com"
Ground Controller Lvl 1
Message 17 of 19

Re: push declined due to email privacy restrictions

Go to Settings/Emails on your GitHub account and uncheck "Block command line pushes that expose my email"

Ground Controller Lvl 2
Message 18 of 19

Re: push declined due to email privacy restrictions

I had the same problem, and spent a long time fiddling until I realized that git wasn't taking the userid and email from *either* config file, but from the environment variables $GIT_AUTHOR_EMAIL and $GIT_AUTHOR_NAME (which I had long-since forgotten setting).

 

There seem to be at least four places to check (I *think* this may be the order git checks them in):

  • git commit --author "John Doe <jane@doe.com>"
  • environment variables $GIT_AUTHOR_EMAIL, $GIT_AUTHOR_NAME, etc.
  • .git/config in the current repo
  • ~/.gitconfig

 

For all I know, there may be more....

 

Ground Controller Lvl 1
Message 19 of 19

Re: push declined due to email privacy restrictions

remote: error: GH007: Your push would publish a private email address.
.
.
. To https://github.com/AdiedX/message-template-service.git ! [remote rejected] CC-398-new-download-email-template -> CC-398-new-download-email-template (push declined due to email privacy restrictions) error: failed to push some refs to 'https://github.com/AdiedX/message-template-service.git' ➜ message-template-service git:(CC-398-new-download-email-template) ✗ git push --force

Root cause for me

I had recently changed my Emails settings to make my email private. Github wouldn't allow publishing of the private email. I made my email public again. Now it works.