Git – Sourcetree remote: Invalid username or password

atlassian-sourcetreeauthenticationgitgithub

Im trying to push to github with sourcetree but get the following error:

git -c diff.mnemonicprefix=false -c core.quotepath=false push -v
–tags origin live_version:live_version remote: Invalid username or password. fatal: Authentication failed for
'https://github.com/myname/myrepo/' Pushing to
https://github.com/myname/myrepo

Completed with errors, see above.

enter image description here
However when I go to

tools > authentication > my github account

And click edit > refresh oauth token
enter image description here
A page opens and I get:

Authentication Successful

SourceTree has been successfully authenticated. You may now close this page.

It always worked but it suddenly stopped, i do not have two factor authentication.
I tried deleting the account and adding it again to no avail.
How can I get the connection working again so that I can push my project to github.

Sourcetree version 2.1.8.0

Best Answer

I found the answer here, it is a known bug for version 2.1.8+

The following steps fixed it for me:

Tools > Options > Git > Update Embedded Git

Also pushing with the command line works.

EDIT

Also adding @Latisha's answer:

1. Do the above.
2. Close Sourcetree
3. Delete AppData\Local\Atlassian\SourceTree\passwd 
4. Restart SourceTree