In SourceTree, I'm getting the "fatal: Authentication failed for..." error when I try to Push/Pull from origin.
The Git terminal from SourceTree asks for my username/password and, when I enter it, it works correctly (I'm able to do a push/pull anyway). However, nothing I've tried will allow me to use the push/pull buttons in SourceTree. I've updated my Git username every place I've been able to see something that resembles a username, I've gone to Tools > Options > Authentication > [My Account] and set the password (which is a private access token).
I saw a similar question that mentioned "There is a SourceTree Application password stored in the login keychain." But I have no idea what the login keychain is or how I can fix it in SourceTree.
Details:
- SourceTree version 2.1.10.0
- Git version 2.7.0
- Windows 10 Pro, 64 bit
- origin server is Visual Studio Team Services
I'm not sure why it stopped working (I haven't changed my VSTS password and all my private access tokens are still valid), but I seem to recall an odd password box that popped up a week or so ago that I believe came from SourceTree. I might have entered the wrong password, but didn't see any problems at that time (I haven't pushed/pulled since then, so wouldn't have seen any problems until today).
What am I missing?
David's answer to this question worked for me...
The only thing that worked for me was navigating to C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree and removing the passwd file.
Once that file was deleted, I just did a "Push" and it finally asked for my password.
A note to Atlassian, there should be a much simpler way to do this than spending hours searching the Internet looking for an answer. If getting the Authentication page to work as expected is not possible, then perhaps just a button that users that are having trouble can press on the Authentication page that would reset all the passwords (basically just delete this file for us).
Thanks a lot! I was speending 2 days touching options in the sourcetree. This answerd save my day!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yeah it worked for me as well. I cant believe that source tree would be so lazy, this is a software thats used by millions of devs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OMG thanks, It was driving me crazy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I resorted to git bash since source tree stopped working. Thanks for the fix. Sourcetree! \,,/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For some retarded reason the field to type in your email adress is greyed out and it has an email adress in it that doesn't even have an atlassian account. I can not change my email adress whatsoever. I've deleted the account file and restarted it. I've checked the tools bar into the authentication and removed everything there. I've even reinstalled source tree and it still won't let me change the email adress. Holy shit I regret updating to this horrible version. I'm stuck not being able to fetch or pull anything. Even the crash report pop up crashes when I submit this shit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Fix: I removed everything from sourcetree and downloaded an older version.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Removing the passwd file worked for me. This was driving me crazy for the past few weeks. Thanks for the solution! I was actually looking for other options to use instead of Sourcetree until finding this fix. It would really helpful if there were an easier way to force the password prompt.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Does anyone know what the password file is called?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks! This helped a lot. It is a pity that such a simple thing is broken.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
THANK YOU!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It worked. Now I'm able to do all the operations in source tree tool. Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Still working in 2018. Just solved my problem- next clone prompted for me to enter a password, and all went smoothly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I updated the SourceTree and the authentications failed. I wiped out the SourceTree (uninstall and the directory deleted) and installed 2.4.7.0 SourceTree. I had the same problem: after asking the password to the local GIT server the session failed because of SSH_ASKPASS. I wiped out the SourceTree again and installed 2.1.2.5 version. It works normally.
SourceTree is a great tool if it works. The obvious recent modifications to the authentification code do not work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
THANK YOU !!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It worked for me too. Stuff like this is why I down vote SourceTree when asked if I would recommend it. It actually prompts an email to my manager to go back to TFS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same here it worked for me after installing 2.1.2.5 Version. I hope atlassian is taking notes. GIT+SSH with username password does not work on 2.4.7.0. Please fix it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've reinstalled sourcetree and git (without credential manager and with it), generated several github acess tokens and without success.... and your solution helps! So THANK YOU ! I think that it should be in the docs or in the bug tracker :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It seems that deleting (or perhaps renaming) a file worked for me as well. Thanks @bbrewder!
Of course, I had to find the path for MacOS.
For anyone else looking for that path it is ~/Library/Application Support/SourceTree and then look for a file similar to username\@STAuth-path.to.gitrepository.com
I simply appended the filename (just in case it didn't work). Afterward, I did a fetch (I'd imagine any server command would work) and I was prompted for a new password.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Seriously?! a dev tool having such basic issue... I can't imagine amount of time lost by anyone using it including me
Thanks for the tips Brian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I had the same error and I saw this post, but deleting the password file did not work for me. it turned out that my VSO personal access token was expired. I had to renew it. Just FYI for anybody who use visual studio online.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, this worked for me as well :-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a million!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks sooo much. i have looked for hours for this.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much... the tip still works today!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So before a fancy login box came up but my password never worked in it. But then when I detest this. The fancy login box didn't come up but a not so fancy box replaced it. The only difference is that my password worked on this one. So thanks for this :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot! That was the problem!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you! This was exactly the answer I was looking for.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just hit this same problem. Deleting the pwd file worked.
This bug needs fixing! How many thousands of dev hours are wasted on this stupid bug!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot. it worked seamlessly
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Still working. Thx a lot
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's a pity, we have to do such things manually after a year...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot.
After 1 year this bug is still present and it almost led me to use gitkraken.
Please do better with sourcetree.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Still valid! Thank you so much! I was getting crazy!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the solution
not so fancy box accept my pass :D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot !!!
A week of research for this bug...
Deleting the password file of attlasian does the work !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I do not know what to expect to fix this bug, thank you very much!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have multiple accounts set up, it's not necessary to delete the whole passwd file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Almost the end of 2018 and this problem still persist. Deleting the passwd file was the only way to get around.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's 2019 already, but still not all heroes wear capes.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you! After 3 hours of struggling, I can finally START the introduction on bitbucket.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Delete of password file worked for me. THANKS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After hours of searching..... This finally worked!!!!
This is a flaw, and should be fixed!. Come on!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
also after hours and hours of searching lol.. cmon guys..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It helps, thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for this answer. This helped me as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ha thanks, lost 30 min of my life there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
2020, it's still working. Thanks! :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same here, 2021 and still an issue. I'd tried removing my accounts in sourcetree in the options menu and re-authing with the pat token and still no joy. I did this though as cjdennis mentioned instead (so I didn't loose passwords set for my other accounts):
cjdennis Dec 18, 2018
If you have multiple accounts set up, it's not necessary to delete the whole passwd file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Despite all saved account under Tools > Options > Authentication, this password file is not getting deleted. Only after manual deletion is when SourceTree prompted for login and things worked fine then
Thanks for this DAY SAVER TIP !!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
And here I am - a git newbie four years on and still tripping over this. Wasted time and got severely demoralised when stuck at such a basic point with such a simple solution (simple when you know how!).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
2022 running v3.3.8 and I'm still routinely having to use this fix. Poor effort by Atlassian. Bitbucket's UX isn't great as it is but furthermore it's riddled with bugs. Thanks for the tip.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wow - that helped!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Worked like a charm! Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Very good. Thanks. I quit using SourceTree for yet another git GUI because of this problem...then hit the same problem there and realised it wasn't a SourceTree thing.
Back to SourceTree now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you! Same today 13.09.2023. on Sourcetree version 3.4.14 .
Command: git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks ls-remote 'https://*******'
Output:
Error: fatal: Authentication failed for 'https://*******'
Issue was solved for me as described upper with:
going into path C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree and removing the passwd file.
Starting again source tree, going to clone, and prompted me for password.
Before I had authentication failure, even in tools -> options -> authentication, user was OK authenticated.
This was making confusion, like why was authentication failure, if user is successfully authenticated in settings now we know that there is additional file with authentication parameters.
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Somebody at Atlassian needs to write a blog with clear steps to resolve this issue, this continues to be an issue for many people. I had originally reported my problem in 2017 and we are in 2019 and people still seem to be struggling with basic functionality such as login.
I run into these errors every time my password is changed. Recently I had to uninstall and reinstall the software to get authenticated. Is this really a solution ? I hope somebody at atlassian takes this seriously and write a clear documentation about this issue. When done please post the link to this issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Go to Tools -> Options in SourceTree and then go to the Authentication tab on the Options popup. Delete all of the stored passwords. Try again, you should have another opportunity to enter authentication credentials. I'm using 3.0.8 and that worked for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That did the job for me, thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great it's work for me as well. My Source tree version was 3.0.12
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This worked for me. I had just updated my DI2E (Bitbucket) password, and even though I tried updating the password with the edit button in SourceTree, that didn't work. Removing all the passwords worked. I am using 3.0.17.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you.
This worked for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you are using sourcetree with bitbucket, I had to go in and change the Username to an email address in the file location below. I believe bitbucket swapped the log in from using usernames to email addresses but source tree wouldn't take it on it's normal login pop up screen.
C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree\accounts.json
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for menting this, though I had to switch the Username back to our network user from the email address.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am putting all the steps I tried in the sequence and finally one thing worked. The solutions are suggested by other Stash/Sourcetree Users.
Solution A, Didn't work. Might work for others. Good Luck!
Solution B. Didn't work. Might work for others. Good Luck!
Navigating to C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree and removing the passwd file.
Solution C. Worked. Might be due to above steps performed above.
Sourcetree > Tools > Authentication > Deleted my Stash account > Added it again.
I hope the above post helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for summarization. Solution A worked for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Solution B works perfectly
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
B & C option works together
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
B worked for me, thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
JUST GO TO TERMINAL IN THE CORRECT FOLDER
TYPE: GIT PUSH
USERNAME AND PASSWORD
DONE!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That was easy. Worked for me with Window 7. Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
this was the only thing that worked for me on a mac, thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
For anyone still having this issue, you can go in Repository>Refresh Remote Repository. This seem to re-enable the authentication form .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great.
Removing the passwd file.
For 3 years I had to put username and password into URL as an workaround before finding this answer!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The "fatal: Authentication failed" error in SourceTree typically occurs when there is an issue with the stored credentials or authentication settings.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can do the following things
Open a Git terminal from SourceTree and verify your Git configurations by running the following commands
git config --global user.name
git config --global user.email
git config -l
Take small steps and try these things, make sure to backup any local changes or repositories.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So here we are in 2022, and these problem are still present!
Driving me NUTS.
I suddenly had authentication problems while contacting a remote git repository from Sourcetree, possible initiated by a password change on Windows.
Contacting over a web interface and from Visual Studio did WORK.
So I was sure of my credentials.
But trying all sorts things within Sourcetree did NOT change a damn thing.
Finally I found this post which saved my day, after hours of frustration.
I renamed the file C:\Users\USER\AppData\Local\Atlassian\SourceTree\passwd.
Then I asked my credentials and it all suddenly worked again, creating a new passwd file.
Come on Atlassian!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome!! it's work fined for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, it absolutely helped me
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I delete password file and it works, soure tree is terrible
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nothing is working for me. This is so frustrating, I have lost days messing about with this and two of my team are also having the same issue. Its not like I have an urgent build for 100,000 users that I need to get out the door or anything. I think its time to take my business elsewhere
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ugh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I solved the issue by looking up Keychain Access with spotlight then deleted the Application password for that particular git url. I then opened the repository through SourceTree and it prompted me for a new password. The Keychain Access was then updated and worked after that
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.