Vincent Montalieu
Vincent Montalieu

Reputation: 333

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!

Upvotes: 4

Views: 17571

Answers (8)

shabbado
shabbado

Reputation: 11

I was able to fix this on SourceTree 3.1.1 by going to Preferences->Account->Edit->Connect Account.

Upvotes: 0

Andrey Stukalin
Andrey Stukalin

Reputation: 5909

On Windows you might try to remove OR edit the %LOCALAPPDATA%\Atlassian\SourceTree\passwd file. Edit means removing only the lines which correspond to the failed credentials

Upvotes: 1

davity
davity

Reputation: 101

Happend to me on SourceTree for Mac.

Username from SourceTree -> Preference -> Accounts and SourceTree -> Preference -> Network need to be aligned.

Upvotes: 1

BigMiner
BigMiner

Reputation: 2192

One possible answer to this problem is to update your local version of git or update your embedded version of git. Newer versions of sourcetree do not play nice with older versions of git.

https://community.atlassian.com/t5/Bitbucket-questions/SourceTree-2-1-10-0-Authentication-Issues/qaq-p/623202

Upvotes: 0

Samet ÖZTOPRAK
Samet ÖZTOPRAK

Reputation: 3346

SourceTree -> Preference --> accounts you can delete and add your account again and then try SourceTree -> Preference set Protocol = HTTPS

Upvotes: 2

Genki
Genki

Reputation: 3195

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.

Upvotes: 2

Daniel
Daniel

Reputation: 1

SourceTree on Mac then go to SourceTree -> Preference -> Network. You'll see your username and GitHub location. Remove it. Next, when you push to your repo, you'll be prompted for username and password (to save to chain).

Ideally, there was a password field here.

Upvotes: 0

Anuj Panwar
Anuj Panwar

Reputation: 683

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.

Upvotes: 16

Related Questions