How to update HTTP(S) credentials in sourcetree

I'm using Stash, Sourcetree and Crowd. Crowd authenticates with our AD server. One of our users' AD passwords expired today and he went to do some work via sourcetree and it wouldn't let him communicate with stash properly

He set up the repo initially as HTTP when he first cloned it. It asked him for his username and password and he says he remembers clicking "Save/remember password"

Where can I have him reset/remove these credentials.

I've already worked around the issue by setting up SSH keys for this user, but I'm interested in what the fix would be. Presumably something via the command line, as I've been through every GUI screen I would think could have the setting in it.

5 answers

1 accepted

The only thing that worked for me was navigating to C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree and removing the passwd file.


Once this file is removed, restart SourceTree and execute a fetch or something else that requires access to the repo in question. SourceTree will then prompt you for your password, rewriting the cached credentials.


I hope this helps. Shoutout to my buddy Nick for the assist.


If you're a macOS user, Auke states below that "you can find the password files per repo it in ~/Library/Application Support/SourceTree"

This saved my time. Thanks!

This worked great.  I've been digging into this for over an hour!  Thanks.

This is also the only thing that worked for me.  Josh is lucky, i've spent about 5 hours on this between 2 different computer and creating new passwords!


This worked for me as well.

worked, thank you!!

Only this solved "Authentication failed for" error for me. Thanks!

Saved me too. Thank you!

Alternatively, if you're a mac user, you can find the password files per repo it in ~/Library/Application Support/SourceTree

Auke ter Horst You saved me! Thank you so much! I'm also mac user.

Thank you David!!!

It worked for me. Thx a lot !

Thanks David Keck! This saved me much pain and agony. 

Cool, worked for me, thanks a lot !

Only way I could get access to my remote repo again. Thanks heaps!!

Thank you so much, it's helped :).

This worked! Thank you very much.

jingjing I'm New Here Sep 25, 2017

Thank you so much! That's the only thing works for me. I have been spending too long on this.

jingjing I'm New Here Sep 25, 2017

Thank you so much! That's working!

This worked for me too! Thanks.

This was the solution!!! Spent some time trying to fix this... Thanks!!!

I'm so happy to see that this helped! Auke, I'll update the main answer with your macOS findings.

Thank you. This worked for me.

This was the answer for me to delete the C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree\passwd file,  however, I also needed to change the username, and there was no way to do this through the sourcetree interface.


I found a file C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree\userhosts    which had the wrong username.  I changed it there and restarted and then it was able to push github repos to the correct username.

thanks David. your solution worked for Authenticate error.


1) the failure ocurred on my SourceTree v2.3.x.x, when I updated my network Windows password.
2) When I ran ST v2.0.20.1 executable, no authentication error was encountered.
3) When I re-ran v2.3.x.x again, the authentication error resurfaced again.
4) Then, I came upon your solution and tried it, v2.3.x.x is working fine now. The original password file was dated ard 2 months ago, likely the last time it was changed before i upgraded to v2.3.x.x?

5) Before all these, i also tried the Tools-> Options -> Password change method.
It says authenticated after giving the correct password, but when I fetched my Repo, the authentication will fail. So apparently the passwd file in (4) could not be updated, which caused repo actions to fail?

Maybe it's a version bug?

Yep! That is the solution. Thank you very much David! 

Zorobabel I'm New Here Nov 01, 2017

Thanks, this is the right solution

Thanks David! This worked perfectly, only wish I had found your answer sooner!

Works for me. Credentials are not visible anywhere on the UI, not on the Tools->Options->Authentication tab, repository settings or Windows Credential Manager. Is there a JIRA ticket about this issue?

Nice, it worked, thank you!!

Finally. Thank you!

This worked for me with version

Thank you, and thanks to Mauricio Salazar for the userhosts info!

If this is Windows, you do this in Tools > Options > Authentication, you can delete or update any passwords there.

On the Mac, you can do the same by starting Keychain Access and locating the password entries there.

I had exactly the same issue on a Mac and could solve it using this answer.

Had same issue on my mac, and solved it by changing credentials on Keychain Access. Thanks!

Thx man, solve my problem.

This doesn't work for me. When you hit delete, it will not do anything. When you hit edit, it will create a new entry with wrong information.

This STILL doesn't work, even in the latest builds. Authentication says all good but when you pull/push you get authentication failure. It obviously stores the repo pass in some convoluted system that doesn't work.

I had a similar problem on Windows 10 when I wanted to use a new account on GitHub.  SourceTree was using cached credentials, and not displaying them on its internal dialogs, and I struggled to find a way to clear them.  I only worked out what was going on when I tried from Git Bash and had the same problem.  The credentials were definitely NOT on Tools -> Options -> Authentication.

The reason is SourceTree uses the Windows Credentials Store, so rather surprisingly you have to go to Control Panel.  Then Users and Accounts/Manage Your Credentials/Windows Credentials (it defaults to Web Credentials, which isn't what you want).  I had an entry for under 'Generic Credentials'.  

I deleted this from the credentials screen and then tried to push from SourceTree, which now asked me for the new credentials and performed the push using them.

I don't know how easy Microsoft have made it for third-parties to at least show these credentials on their screens, but I would think this would be a reasonable enhancement for SourceTree to make.

Same procedure should be followed on Windows 7 if just trying to change the password through Sourctree options fails.

Thx man, solve my problem.

Respectfully I must disagree with Steve's answer: It doesn't work at least for me because in Authentication there's no saved credentials for and stash. I updated all my credentials for bitbucket and other vendors on the web, later i have to find out that i cannot log in to bitbucket in sourcetree, and there's no way for me to clear saved credentials. Except maybe wipe the local storage where sourcetree saves the preferences etc. but that can't the solution.

Edit: environment is windows.

The credentials for windows are managed in the Windows Credential Manager in the Control Panel.

Suggest an answer

Log in or Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

274 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot