3

I can't push to a new repository of github, the terminal prompts this message:

ERROR: You must verify your email address.
See https://github.com/settings/emails.

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

The email is verified on that section of github and it is the same that this commands return:

git config user.email
git config --global user.email
  • 1
    Does this answer your question? [Git push error "You must verify your email address."](https://stackoverflow.com/questions/40660326/git-push-error-you-must-verify-your-email-address) – Mark Loeser Feb 25 '20 at 17:21
  • No, I tried all those solutions and didn't work for me – Esteban Arocha Ortuño Feb 25 '20 at 17:27
  • Did you read the URL mentioned to learn about how to verify your email address with `github` so that they will grant you the permission you want? – twalberg Feb 25 '20 at 21:02

2 Answers2

2

One more option: Check your git config credential.helper output

If the helper is caching the wrong credentials, it will use the wrong account (with an email still unverified).
Force it to ask you again said credentials with (as explained in "How do I sign out in the Git Bash console?")

git credential-manager reject https://github.com

The next push will force you to enter the right account/password, which would then pass the email verification step, since you mention the account has already verified its email.

On Mac (osxkeychain) use the git credential-osxkeychain erase command

printf 'host=github.com\nprotocol=https\n\n' | git credential-osxkeychain erase

But if your URL is already an SSH one (git@github.com or ssh://git@github.com)... then credential helpers won't matter.

"changing it to an URL" (possibly HTTPS) and having it work means the right credentials were cached (for HTTPS github.com URL).

The other option was to rename/save the ~/.ssh/id_rsa(.pub) files and regenerate SSH keys, associating them with the right account (the one with the verified email).
Then no URL change would be needed.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

Somehow the SSH link was giving me trouble, but I changed it to an URL and it started working.

  • I have edited my answer to explain why "changed it to an URL" work, but also to hightlight the SSH URL should still work. – VonC Feb 26 '20 at 06:51