github icon indicating copy to clipboard operation
github copied to clipboard

Github push issue - wrong error message

Open mickkael opened this issue 5 years ago • 2 comments

Prerequisites

Description

Steps to Reproduce

  1. Have a Github account with a repo, and email is private
  2. Clone a repo
  3. Do any modification or add
  4. Stage and commit in Git tab
  5. Click the push Button on bottom right
  6. Error message shown:
Push rejected

The tip of your current branch is behind its remote counterpart. Try pulling before pushing.
To force push, hold cmd or ctrl while clicking.
  1. The same push from git command line:
Enumerating objects: 14, done.
Counting objects: 100% (14/14), done.
Delta compression using up to 4 threads
Compressing objects: 100% (8/8), done.
Writing objects: 100% (8/8), 4.44 KiB | 4.44 MiB/s, done.
Total 8 (delta 6), reused 0 (delta 0)
remote: Resolving deltas: 100% (6/6), completed with 6 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 github.com:<GitHub_username>/<GitHub_repo>.git
 ! [remote rejected] master -> master (push declined due to email privacy restrictions)
error: failed to push some refs to '[email protected]:<GitHub_username>/<GitHub_repo>.git'

To resolve this error if anyone else encounters: source git config --global user.email "no_reply email found in github account settings" git rebase -i git commit --amend --reset-author git rebase --continue

Eventually the push is working from Atom now.

Expected behavior:

Have the exact error message that git is throwing:

  1. remote: error: GH007: Your push would publish a private email address.
  2. ! [remote rejected] master -> master (push declined due to email privacy restrictions) error: failed to push some refs to '[email protected]:<GitHub_username>/<GitHub_repo>.git'

Actual behavior:

Push rejected

The tip of your current branch is behind its remote counterpart. Try pulling before pushing. To force push, hold cmd or ctrl while clicking.

Reproduces how often:

Always

Versions

Atom : 1.45.0 Electron: 4.2.7 Chrome : 69.0.3497.128 Node : 10.11.0

mickkael avatar Apr 19 '20 13:04 mickkael

I think I saw a similar issue when I tried pushing a file too large for github (not realising that was a problem). Rather than report that problem I got the

Push rejected

The tip of your current branch is behind its remote counterpart. Try pulling before pushing.
To force push, hold cmd or ctrl while clicking.

response, which sent me off trying to figure out how my repo got corrupted.

Would be better if the error messages passed through to atom git integration were a more accurate reflection of the actual problem

DOSull avatar Oct 08 '20 23:10 DOSull

It seems to be the default error message that's just shown regardless, I got it with the email privacy rejection mentioned above, as well as just now with github rejecting my push due to my personal access token not having the workflow scope.

LunarTwilight avatar Mar 25 '22 09:03 LunarTwilight