It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to update HTTP(S) credentials in sourcetree

Josh Love Jul 29, 2013

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.

14 answers

1 accepted

182 votes
Answer accepted
David Keck Jul 18, 2017 • edited Oct 06, 2017

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"

Rajesh Aug 10, 2017

This saved my time. Thanks!

Like # people like this
Josh Hed Aug 11, 2017

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

Rob Baragona Aug 13, 2017 • edited

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!


Christopher Cook Aug 14, 2017

This worked for me as well.

Joseph Testa Aug 14, 2017

worked, thank you!!

Someone Unknown Aug 15, 2017

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

Ben Salvage Aug 16, 2017

Saved me too. Thank you!

Auke Aug 17, 2017

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

Like Bias Corp likes this
jonghyun,yi Aug 17, 2017

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

Adan Serrano Aug 17, 2017

Thank you David!!!

Silvio Di Silvestro Aug 22, 2017

It worked for me. Thx a lot !

Dan Ames Aug 22, 2017

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

Christophe Racine Aug 22, 2017

Cool, worked for me, thanks a lot !

Hilco Aug 23, 2017

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

Loc rabbirt Aug 30, 2017

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

Joe Wright Sep 22, 2017

This worked! Thank you very much.

jingjing Sep 25, 2017

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

jingjing Sep 25, 2017

Thank you so much! That's working!

Sebastian Raemsch Oct 01, 2017

This worked for me too! Thanks.

Bruno Costa Oct 05, 2017

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

David Keck Oct 06, 2017

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

Sergiu Jardan Oct 09, 2017

Thank you. This worked for me.

Mauricio Salazar Oct 17, 2017

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.

Like # people like this
David Teo Oct 18, 2017 • edited

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?

Konstantin Pogorelov Oct 19, 2017

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

David Soria Nov 01, 2017

Thanks, this is the right solution

Lia Gelder Nov 06, 2017

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

Otto Harju Nov 07, 2017

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?

Shreya Rawal Nov 09, 2017

This worked!! :)

Horacio Filet Nov 16, 2017

Nice, it worked, thank you!!

Kaira Nov 27, 2017

Finally. Thank you!

Philip Chan Jan 19, 2018

This worked for me with version

Tracey Gibbons Feb 16, 2018

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

James Attwood Mar 09, 2018

Thank you so much! This worked for me with version Windows 7 64bit

Ron Packard Mar 28, 2018

Worked for me on the Mac.

Antonio Sobalvarro Apr 04, 2018

Works perfect.

David Hubbard Apr 23, 2018

Thanks - this also worked for me - however as it's a central file - if you are using other accounts through SourceTree (e.g. BitBucket, GitHub) then you may want to just remove a single account line from the file rather than deleting the whole file.

Plus, as the User account used by SourceTree is also referenced in answers here - To specify a specific user account (which is not the default) I found that setting userid in the repo path (Settings > Remotes > Edit) e.g. http://myRepoUser@myrepo:3000/organisation/myrepo.git worked for an internal git server.  

Karl Zuvela May 09, 2018

This worked for me only after changing my Windows password again, as Sourcetree does not seem to accept passwords that begin with a special character such as '-'. Once I changed my password to begin with a letter then everything functioned as expected.

isac joseph Jun 03, 2018

THanks maan..

Olga Farber Jul 08, 2018

thank you so much! only this helped me, too

Abner Souza Jul 15, 2018

Not working for tried many times to login to git in vsonline it was working just fine, but removed the keys from keychain, also reinstall and tried to clean up everything, when i type the credential it does not work and show the following on my mac:

fatal: Authentication failed for;


Even the credentials are correct

Manny Yu Aug 06, 2018

Works for me. Thanks much!

Krzysztof Gałązka Aug 08, 2018

Worked like a charm! Thank you!

Great. Worked for me too. Thanks

Robert Pal Sep 11, 2018

Worked! Thanks!

Anselmo Gomes Oct 13, 2018

Funcionou pra mim! Obrigado! Thanks from Brazil!

lokendra Oct 31, 2018

This worked for me. Thanks

avava2016 Nov 24, 2018

also worked for me

Taras Harasymiv Dec 02, 2018

Thank you, David.  This worked for me.

Andrea Franchini Dec 06, 2018

Worked also for me.
Close Sourcetree, delete the password file, open Sourcetree, random fetch => correct login.

Fred F. Dec 06, 2018

Worked for me, lost about 1 day of my life trying to fix it. 

Jessica Freeney Dec 11, 2018

Was trying to fix this for about a week and this fixed it

Dean Dec 12, 2018

Saved my life. Thanks man!!!

Anssi Pekkola Dec 12, 2018

This solved my problem. Thanks.

Ruben FitzSimons Dec 12, 2018

Many Thanks! Worked a treat!

Levin Purba Dec 19, 2018

Almost the end of 2018 and this problem still persist. Deleting the passwd file was the only way to get around. 

rc_kamran Jan 11, 2019

Thanks alot !

alon katz Jan 15, 2019


Uma Vijayakanthan I'm New Here Jan 19, 2019

Yup did the trick, the problem started when i changed my Atlassian password, after few days i opened source tree and i couldn't login with new password, it kept asking for password over and over again. 

Once removed the passwd file then it all worked! They should address this on the SoruceTree app.



Uma Feb 04, 2019

Thanks boy you are a great boy.

Pravin Bhat I'm New Here Feb 06, 2019

This helped me save time, thanks David!

Atlassian should fix this annoying issue.

Bandula P. Kurundupotha I'm New Here Feb 19, 2019

This really helped me getting resolved the same issue that wasted my time troubleshooting. 

Thank you very much!

Khorshed Alam I'm New Here Mar 22, 2019

Million Thanks! You are rock!! 


Like Jaque Nande likes this
Jaque Nande I'm New Here Friday

Thank you so much :D

15 votes
Rich Newman Apr 04, 2016

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.

Henrik Samuelsson Jun 19, 2016

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

Maksim Borisov Aug 23, 2017

Worked! thanks

Breno Santos Sep 06, 2017

Thx man, solve my problem.

Thank you Rich, it worked for me, i was look at all the places for a solution. I had even removed the credentials from Web Credentials page. I saw there were 3 different credentials for git which when removed worked for me.

12 votes
Steve Streeting Jul 30, 2013

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.

Douglas Kazumi Feb 20, 2017

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

Sangbeom Kim Aug 09, 2017

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

Breno Santos Sep 06, 2017

Thx man, solve my problem.

Frank Frank Sep 06, 2017

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.

Akira Kaneda Oct 09, 2017 • edited

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.

Alexander Manoharan Jul 02, 2018

Thanks, it worked for me

Brett Shellhammer Jul 06, 2018

Thank you ... this worked great !!

Olga Farber Jul 08, 2018

Doesn't work in Windows, all says "authentication ok", but then pull gives again authentication error. Only thing that helped was to go and delete that file

Ian Kleinfeld Sep 25, 2018

This worked great for me -- I just deleted my password, then it asked for it next time I accessed the remote and all was good.

When I just "edited" it, it didn't work. 

2 votes
Daniel Brinca Jul 18, 2018

On SourceTree 2.7.6 you can easily reset your repo credentials, without having to mess manually with files, by following these steps:

  1. Open SourceTree preferences
  2. Go to the Advanced tab, to the far right
  3. Find the host name of your repo under "Default usernames for URLs which do not include one", on the bottom
  4. Press Edit, clear the username (leave it blank), and press OK
  5. Close preferences, do a Fetch on your repo, and enter the new credentials when prompted
Keri-Lyn Crovo Oct 11, 2018

I had to remove all the account information in here, have it prompt me for username/password (tried to clone empty repo from BBS in SourceTree), then I was able to connect enough to clone. What a pain!

Elizabeth Brealey Nov 16, 2018

This solved my problem!  Thank you!

Alvis Or I'm New Here May 07, 2019

Solved it for me on Mac. Thanks!

0 votes
Ersi Ni Nov 21, 2014

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.

0 votes
Alexandru Puiu Mar 08, 2017

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

Keri-Lyn Crovo Oct 11, 2018

Unless Git-Credential Manager is installed and ruins everything!

Like Silver Põld likes this
0 votes
Jared Rypka-Hauer Jul 03, 2018

Just for the sake of having complete use cases here... I had what I thought was the same problem. Turned out that our auth scheme had changed and we started logging in with just the username portion of our email addresses... so jrypkahauer instead of The real problem came when I added "" to the list of default usernames for our domain.

So effectively I had inadvertently made it impossible for myself to use the correct username on the domain where our git repositories all live.

It took me nearly 4 months of fighting this to figure out why ONLY SourceTree forced me to use an old, invalid username but would still prompt for the password if it was provided. Today I went panel by panel thru the entire Preferences UI and finally found this one.

0 votes
Reyelle Matanguihan Jul 11, 2018

This didn't worked for me. There is no password file under C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree\

This is always what I get:


Bias Corp Nov 05, 2018

hanks guys. It was helpful

0 votes
Ruedi Heimlicher Nov 13, 2018

Mac user: In High Sierra I found the Auth file in 

~/Library/Application Support/SourceTree

File: <username>

I removed this file, restarted SourcTree and was prompted for the password in the push process.

0 votes
David Sadowski Dec 04, 2018

Mac OSX 13.3.3, deleting password files doens't work for SourceTree 3.0.1 when trying to connect to Atlassian Bitbucket v5.11.1 self-hosted server. I managed to connect to Cloud BB and was only then able to get into the app's options otherwise it's completely useless. I still am unable to use it with the above BB server we're hosting so another broken cr*p from Atlassian.

0 votes
Dean Dec 19, 2018

Just use Git Desktop. Tired of this bloody popup authentication modal!!!!!!!!!!!!!!!!!!!

Dan Ames I'm New Here Dec 19, 2018

I agree completely. I've recently switched to Git Desktop and love the simplicity and ease of it.

Like Dean likes this
0 votes
Anthony Rich Feb 14, 2019

You don't have to blow away your whole password store.

In SourceTree navigate to the repository in question, click the Terminal button and type `git pull`. It will prompt you for the required credentials then you're good-to-go in the GUI as well.

Jeff Szczypinski I'm New Here May 22, 2019

That didn't work for me.

0 votes
Xolela Masebeni Feb 21, 2019

You can also simply add your username in front of you repository address: e.g: git clone


You will then be prompted to put in your new password on your next pull or push. From there you will not be prompted for a password until you change it again.

Laurence Henderson I'm New Here Apr 08, 2019

Can anyone tell me what the password filename is

David Hubbard Apr 08, 2019

As per the accepted answer (assuming you are on Windows) C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree\passwd

0 votes
Jeff Szczypinski I'm New Here May 22, 2019

I had to go to the C:\Users\<user>\AppData\Local\Atlassian\SourceTree directory and delete the cache folder and the passwd and userhosts files. Restart Source Tree, do a pull and it prompted me for the ID and PW.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

379 views 0 9
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you