Change username Github "You must verify your email address" 403 error on git push
Asked Answered
G

6

7

enter image description here

I recently changed my username on github (so that everything redirects to a new URL on my username)

I got this error through a cmd line git push

enter image description here

You must verify your email address

Fatal: The request URL returned error: 403

However, github wouldn't let me resend email verification under account > settings

I also did the following, per githubs guidelines on username change

git remote set-url origin https://github.com/myNewUserName/repo-name

on all my new repos. Then I ensured I had the emails set correctly on my .git/config file

git config --global user.email "[email protected]"

Still could not fix problem

Graaf answered 7/8, 2017 at 15:59 Comment(0)
G
4

SOLUTION: I ended up contacting github support

Github support said to use this command

git config --global --unset credential.helper

so that I could re-enter my account information when sending git push

This didn't work so I had to go to

Control PanelUser AccountsCredential ManagerWindows Credential Manager → Delete the one associated with github

Since my repos were committed under my old-username, there were conflicts using my new-username, despite the fact I had no email changes.

I had to disable "Block-command line pushes that expose your personal email address" as one potential solution. I have a dedicated email when sending commits so this is not a problem for me

enter image description here

Per github, the reasons are as follows:

If you want to keep this feature enabled (block cmd line expose email), you'll need to re-write the Git history of this repository to remove your private email address from the author info for each commit. Alternatively you can turn off this feature.

Alternate solutions here

https://help.github.com/articles/blocking-command-line-pushes-that-expose-your-personal-email-address/

https://help.github.com/articles/changing-author-info

Settings information here

https://github.com/settings/emails

hopefully this helps out someone when changing their github username

Graaf answered 7/8, 2017 at 15:59 Comment(2)
I had the same issue and just git config --global --unset credential.helper worked for me. Thanks a lot for sharing this!Trebuchet
@francescoBorzi no problem :)Graaf
E
2

For OSX had to access keychain app and delete the key associated with github.

They key had a '@' symbol.

Embroidery answered 12/12, 2018 at 15:43 Comment(0)
U
2

The problem for me was that I cloned the repo originally over HTTPS and had 2FA enabled. Once I set the remote URL to SSH, then it all worked fine!

git remote set-url origin [email protected]:user/repo-name.git
Underproduction answered 27/3, 2020 at 11:14 Comment(1)
Bingo! The problem is on quick setup page for any new repo! They suggest (by default) to use git remote add origin https://github.com/user/repo.git instead of [email protected]:user/repo.git. You should manually switch from HTTP to SSH at the top of page.Graduated
T
0

The key point is to know which account to handle.

Firstly, you shall check the email .

git config user.email

You got the email, then verify it .

The Github helper is in detail Verifying your email address

Login Github account according to the email , Settings -> Emails -> Send verification email,

enter image description here All you need to do is to check Github's link in your mailbox.

Tonytonya answered 22/10, 2018 at 17:31 Comment(0)
R
0

I was experiencing this error, and the following solved my issue:

ssh-add -D && ssh-add
Ron answered 25/7, 2019 at 20:56 Comment(0)
S
0

For me, on osx, I had to delete the github keys and passwords using the Keychain Access tool. However, at first this didn't work, it just wasn't deleting the keys, it was just freezing up.

I think what fixed that for me, I had to open XCode which had some additional tools to install, then after that I closed XCode and was able to delete the github keys and passwords.

Strontia answered 16/12, 2019 at 17:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.