Reputation: 181
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
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
[credential]
helper = osxkeychain
git push --set-upstream origin master
Upvotes: 0
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
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
Reputation: 1630
I just checked my repository and saw a message from github.
Now click on verify email and it will send an email and you are all set. It worked for me.
Upvotes: -1
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
Reputation: 5540
I tried all these, but neither worked:
git config user.email
to make sure it is correctgit config user.email
and it was all goodssh -T [email protected]
to make sure it is authorisedssh-add -d
to remove any added key, generated a new key and added to ssh-agent and githubcat ~/.ssh/config
to make sure there is no invalid username thereWhat worked was very simple: restarting my machine
Hope it works for you as well.
Upvotes: 1
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
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
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.
In my case, there are many github accounts in keychain.
Upvotes: 7
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
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 outgit push
command ( When access Github over HTTPS ), Git will use the username and password thatosxkeychain
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
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
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