github push rejected because it would publish a private email address

Answered

Hi everyone,

I installed IDEA onto my new laptop, set up everything, but now everytime I push my project to Github I get this error message in the console:


13:42:58.318: [java_courses] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false push --progress --porcelain origin refs/heads/master:master --set-upstream
Delta compression using up to 8 threads
Total 20 (delta 10), reused 0 (delta 0), pack-reused 0
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
error: failed to push some refs to 'https://github.com/Kabraxis/java_courses'
To https://github.com/Kabraxis/java_courses
! refs/heads/master:refs/heads/master [remote rejected] (push declined due to email privacy restrictions)
Done


After researching on Google and checking the settings in IDEA I'm still not able to fix this issue, so I hope someone here may be so kind
to guide me where to find the right place to look at in setting.

Just as I side note I'm still pretty new to all of this :)

Cheers

1
2 comments

Hello SnitgitTheGitsnit

This is GitHub protecting you from exposing your email accidentally. See https://github.com/blog/2346-private-emails-now-more-private

So what you can do here is to change user.email address in your git config, or enable pushing with private emails.
See https://stackoverflow.com/questions/43863522/your-push-would-publish-a-private-email-address-error

 

Please let us know if it helps

0

Hello Ruslan, 

thanks for your help.
Yesterday I, too, had some help of a friend of mine. We tried to change the email address for global and local, reset the author and quiet a lot more.
By accident I recognized, when I clicked in the bottom right corner on the branch I'm working with, that there only was the local branch. So what I did was to pull the project, merged it and than I was able to push it. 

Unfortunately I can not reconstruct all the steps I did here, but what I remember is that after the pull was completed I was typing "git push" into the terminal and then I was requested to enter my login from GitHub - after logging in here too (I already linked my account in the VCS) everything was fine.

I was not aware of the need to also pull the project from the server after I cloned it. Maybe it's a good idea to notify the user about this if he faces trouble when trying to push after the clone but a pull haven't been performed.

I'm glad I didn't have to change any privacy setting in GitHub, so my mail address is still protected.

 

All the best

Snitgit

0

Please sign in to leave a comment.