Confusing error message when pushing with `Block command line pushes that expose my email` enabled on GitHub
Update by @rsese with updated repro steps and description
If you have Block command line pushes that expose my email enabled in your GitHub settings and try to push a commit with a private email, you see this error notification:
The tip of your current branch is behind its remote counterpart. Try pulling before pushing.
To force push, hold cmd or ctrl while clicking.
The error with more information shown on the command line and in devtools in Atom is:
stderr: 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

Steps to reproduce:
- Enable
Block command line pushes that expose my emailin https://github.com/settings/emails - For some repo, add and commit a change that uses a private email address
- Push the change
Expect the error message to explain the underlying error, actual behavior is the error message mentioned above.
Prerequisites
- Have you tried to reproduce the problem in Safe Mode? Yes
- Have you followed all applicable steps in the debugging guide? Yes
- Have you checked the FAQs on the message board for common solutions? Yes
- Have you checked that your issue isn't already filed? Yes
Description
When attempting to push a commit to GitHub, I get the following error;
The tip of your current branch is behind its remote counterpart. Try pulling before pushing.
To force push, hold cmd or ctrl while clicking.
Force push also throws the same error.
Steps to Reproduce
- Create a new, empty repo, then clone it into atom
- Edit a file, and create a commit
- Attempt to push the commit
Expected behavior:
I expected it to push the commit and change on GitHub
Actual behavior:
It threw the above error
Reproduces how often:
100% of the time
Versions
Atom : 1.34.0
Electron: 2.0.16
Chrome : 61.0.3163.100
Node : 8.9.3
apm 2.1.3
npm 6.2.0
node 8.9.3 x64
atom 1.34.0
python
git
visual studio 2015
Additional Information
I have absolutely no idea what I'm doing wrong here. This is a fresh install of atom. All I did was clone the repo, link my GitHub account, make a commit, and try to push it. This happens with any repo, regardless of where I clone it from.
Searching for that error message results in one thing which says it's because I need to pull, but the repo is 100% up to date without question.
Thanks for the report - I just ran through your repro steps but couldn't reproduce:
- Create a new, empty repo, then clone it into atom
- Edit a file, and create a commit
- Attempt to push the commit
Just to add more detail to these steps, can you confirm if this is still correct? This is what I did:
- Create a new empty repository on github.com (i.e. make sure
Initialize this repository with a READMEis not checked) - Start Atom
- Copy the repository URL and use it to clone with
GitHub: Clone - Create a new file (e.g. README.md), add some content e.g. "Hello World", and save it
- Click
Stage All - Add "Initial commit" for the commit message and click commit (it says "Create detached commit" at this point)
- Right-click "Fetch" in the status bar and choose "Push"
That's exactly what I've done, bar a slight change on line 7 - It doesn't say fetch, it says Push 1.
I also attempted to pull before the push as per the error, but again I get exactly the same results. I also get the same error if Initialize this repository with a README is checked, not just empty.
Regardless of the repo, I get this error every single time.
Did you use previous versions of Atom before 1.34.0? If so, is this problem new with 1.34.0?
No I did not, this is the first version I've used. It's a totally fresh installation on a month old installation of Windows 10. I have no idea what could possibly be causing this.
same error here
Same error in my ubuntu+atom 1.20.2
Solved after I uncheck 'Keep my email address private'.
Details: In cmd git push -u origin master Username for 'https://github.com': userName Password for 'https://[email protected]': Counting objects: 9, done. Delta compression using up to 2 threads. Compressing objects: 100% (5/5), done. Writing objects: 100% (9/9), 771 bytes | 385.00 KiB/s, done. Total 9 (delta 1), reused 0 (delta 0) remote: Resolving deltas: 100% (1/1), done. 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/etileyli/someRepo.git ! [remote rejected] master -> master (push declined due to email privacy restrictions)
- First of all clone the directory in which you want to commit.
- Then open that directory in Atom
- Now copy the file which you want to commit and paste it inside the cloned folder.
- Now commit. It worked for me.
I was also having the same issue as mentioned by @Jademalo but after reading comment, posted by @etileyli reminded me that I also have done the same thing, to undo that
-
Go to Email Setting
-
Uncheck

-
Then try again as mentioned by @rsese
I was also having the same issue as mentioned by @Jademalo but after reading comment, posted by @etileyli reminded me that I also have done the same thing, to undo that
- Go to Email Setting
- Uncheck
![]()
- Then try again as mentioned by @rsese
thank you so much! i fixed my problem.
Awesome, that fixed it for me, thank you!
As another note, it's possible to use the GitHub assigned noreply email to get the same result.

Just use that email there, and it will push without error.
Ahhh ok, thanks @etileyli for tracking down the issue, reproduced with 1.42.0-nightly5 on macOS 10.14.6. I should have asked to check devtools console, I see the same error from the command line shown there too:

Updated the issue title and repro steps.
None of these solutions worked for me :(