Johan Kuegelmacher
Johan Kuegelmacher

Reputation: 181

Git push error "You must verify your email address."

When I'm trying to push to GitHub, I get the following error:

remote: You must verify your email address.
remote: See https://github.com/settings/emails.
fatal: unable to access 'https://github.com/user/userRep.git/': The requested URL returned error: 403

I am absolutely sure that my email is already verified. I've tried to add remote url without .git, but it didn't help.

Upvotes: 18

Views: 25205

Answers (13)

Carlos Roso
Carlos Roso

Reputation: 1495

In my case, it was because I'd recently changed my git auth from HTTPS to SSH. I was trying to push using SSH, but Git kept trying the credentials from the keychain.

Based on the solution from jinny-chen, here's what made the trick for me:

  • vim ~/.gitconfig. You can find your config file with git config --show-origin --get credential.helper
  • Remove the helper credential to tell git to stop using user/pass creds
[credential]
   helper = osxkeychain
  • git push --set-upstream origin master

Upvotes: 0

a0s
a0s

Reputation: 506

You cloned repo as https (by default in github interface) and trying to push it through a git protocol. Open .git/config and change url from https to url = [email protected]:....

Upvotes: 1

Liran H
Liran H

Reputation: 10579

In my case it was because I generated the SSH key using ed25519 instead of rsa. Switching to rsa fixed the problem immediately.

Upvotes: 1

Badri Paudel
Badri Paudel

Reputation: 1630

I just checked my repository and saw a message from github.

This is what I saw

Now click on verify email and it will send an email and you are all set. It worked for me.

Upvotes: -1

georgiptr
georgiptr

Reputation: 141

Probably you are not using a SSH key, but username/password authenticaton.

For Windows:

Open Control Panel -> User Accounts -> Credential Manager

Delete GitHub entry

Try again. A window will appear asking for your email/password. Enter your proper credentials.

Upvotes: 2

Ali Nem
Ali Nem

Reputation: 5540

I tried all these, but neither worked:

  • my email address was already verified,
  • checked git config user.email to make sure it is correct
  • also checked git config user.email and it was all good
  • tried removing my ssh key and generating a new one and adding it to the ssh-agent and github
  • checked ssh -T [email protected] to make sure it is authorised
  • did ssh-add -d to remove any added key, generated a new key and added to ssh-agent and github
  • checked the config file by doing cat ~/.ssh/config to make sure there is no invalid username there

What worked was very simple: restarting my machine

Hope it works for you as well.

Upvotes: 1

SimoAmi
SimoAmi

Reputation: 1986

In my case, this happened when I changed my Github password but on my Mac Keychain Access program, the stored password was still the old one. After updating the password in Keychain Access, the git push command worked again.

If you suspect this might be your case, just open Keychain Access on Mac, search for github, and update the password for all relevant entries.

Upvotes: 0

BananaNeil
BananaNeil

Reputation: 10762

I was experiencing this issue on osx (and my email address was verified), the following command solved it for me:

ssh-add -D && ssh-add

Upvotes: 5

dengST30
dengST30

Reputation: 4037

Your can set github url with who you are —— username and password

 git remote set-url origin  https://YourName:[email protected]/YourName/YourRepo.git

I encountered the same issue after changing Github account.


And in earth, you'll need to remove authorization info from Keychain.

one

In my case, there are many github accounts in keychain.

Upvotes: 7

Blair Curie
Blair Curie

Reputation: 11

I verified my email once. When it says You must verify your email address, I verify my email again and problem solve.

Upvotes: 0

Jinny Chen
Jinny Chen

Reputation: 121

I encountered the same issue after changing Github account.

I figure out that it happens because the username and passwords previously used are saved in git credential storage.

Git allows for local storage of credentials, so we don't need to re-enter the username and password each time we request access to Github Repo, and it will automatically go to the specified folder ( .gitconfig )to find the credentials.

On macOSX:

Homebrew preset Git to use osxkeychain to storage credentials. Every time we send out git push command ( When access Github over HTTPS ), Git will use the username and password that osxkeychain saved to ask Github Repo for accessing.

This is WHY git push fatal and keep asking to verify email.

Use git config --show-origin --get credential.helper could find out where .gitconfig file is.

Then you will need to modify this line in .gitconfig : [credential] helper = osxkeychain.

helper = xxxx decides the way that credentials storage.

In my case, I had deleted [credential] helper = osxkeychain and saved the file. So that git would ask for username and passwords while Git push.

After entering new username and password, git push works successfully.

Then I change setting back by :

git  config --global  credential.helper  osxkeychain

Or you could add [credential] helper = osxkeychain back in .gitconfig.

Hope my exeperience could help someone.

Upvotes: 12

Fyodor Yemelyanenko
Fyodor Yemelyanenko

Reputation: 11848

I faced the same error. I suspect it was due to incorrect credentials cached in git (previously I committed to a private repo using different credentials)

Solved by

git push https://username:[email protected]/user/userRep.git

After executing this command, git push started to work.

Upvotes: 17

dawenyang
dawenyang

Reputation: 25

https://github.com/settings/emails to verify your emails,click resend button ,then login your email and click the mail from github to you. that perfect !

Upvotes: -2

Related Questions