Getting "fatal: Authentication failed for..." error

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.


- SourceTree version

- 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?

4 answers

1 accepted

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!

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.

OMG thanks, It was driving me crazy

I resorted to git bash since source tree stopped working. Thanks for the fix. Sourcetree! \,,/

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.

Fix: I removed everything from sourcetree and downloaded an older version. 

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.

Does anyone know what the password file is called?

thanks! This helped a lot.  It is a pity that such a simple thing is broken.  

It worked. Now I'm able to do all the operations in source tree tool. Thank you

Still working in 2018. Just solved my problem- next clone prompted for me to enter a password, and all went smoothly.

I updated the SourceTree and the authentications failed. I wiped out the SourceTree (uninstall and the directory deleted) and installed 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 version. It works normally.

SourceTree is a great tool if it works. The obvious recent modifications to the authentification code do not work.


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.

Same here it worked for me after installing Version. I hope atlassian is taking notes. GIT+SSH with username password does not work on Please fix it.

dkurmanov I'm New Here Mar 06, 2018

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 :)

It seems that deleting (or perhaps renaming) a file worked for me as well. Thanks @Brian Brewder!

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\

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. 

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

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.

Thank you, this worked for me as well :-)

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. 


Thanks for menting this, though I had to switch the Username back to our network user from the email address.  

1 vote
GMM297 I'm New Here Nov 25, 2017





That was easy.  Worked for me with Window 7.  Thanks.

0 vote

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!

  1. Make sure SourceTree is closed
  2. Make sure the files are backed up in the following folders before removing the files
  3. Remove files "bookmarks.xml", "opentabs.xml", "userhosts" in C:\Users\<username>\AppData\Local\Atlassian\SourceTree\
  4. Remove file in C:\Users\<username>\AppData\Local\Atlassian\SourceTree.exe<random_string>\<version_number>\user.config
  5. Open SourceTree again to test if it worked or not.

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!

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 11, 2018 in Sourcetree

Tip from the team: debugging Sourcetree

Supported Platforms macOS Windows If you're reading this and it's not just educational… we know you're unhappy right now and apologize for that   We're dedicated to improving yo...

706 views 10 6
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