Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 402
Vincent Tang Avatar asked Aug 07 '17 15:08

Vincent Tang


People also ask

How do I fix 403 error in GitHub?

There are a few possible causes for this problem: You typed an incorrect password. Make sure you are using the correct GitHub password for the account. The Git client on the A2 Hosting server requires a modified HTTPS URL to work correctly.

How do I change my GitHub email and password in terminal?

Open TerminalTerminalGit Bash. Change the current working directory to the local repository where you want to configure the email address that you associate with your Git commits. Set an email address in Git. You can use your GitHub-provided noreply email address or any email address.


3 Answers

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

like image 72
Vincent Tang Avatar answered Nov 03 '22 08:11

Vincent Tang


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

They key had a '@' symbol.

like image 39
juan Isaza Avatar answered Nov 03 '22 09:11

juan Isaza


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
like image 34
user1974753 Avatar answered Nov 03 '22 09:11

user1974753