Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git / SourceTree - remote invalid username or password

I've just reinstalled SourceTree on my new computer and I'm having trouble when trying to push my commits.

If I use the built-in Push button from SourceTree, it brings up a dialog where I enter my username and password but then I get an error: remote invalid username or password.

The strangest thing is that if I bring the Git console by clicking on the Console button in SourceTree, type git push then enter the exact same credentials, it works...

I'm assuming SourceTree might be overriding some Git config somehow but I can't find a solution.

I tried deleting all credentials saved by SourceTree, I disallowed SourceTree to modify my Git config in the Tools > General menu but it didn't change anything...

Thanks for your help!

like image 211
Vincent Montalieu Avatar asked Nov 30 '22 10:11

Vincent Montalieu


2 Answers

If you are using SourceTree on Mac then go to SourceTree -> Preference -> Network

You will get the list of username for Remote URLs. You can update username there and next push/pull event that username will start getting reflect.

like image 184
Anuj Panwar Avatar answered Dec 06 '22 17:12

Anuj Panwar


I had two factor authentication on, so I needed to create new Personal access token in github.com settings page and use it as my password.

like image 27
Genki Avatar answered Dec 06 '22 15:12

Genki