SourceTree on Mac OS does not remember password

If I pull updates from a remote repo on Github I have to enter my password everytime (twice). In the SourceTree log output I find:

2014-05-20 09:06:09.581 git-credential-sourcetree[33632:507] Error (internetKeychainItemForServer:withUsername:path:port:protocol:) - The specified item could not be found in the keychain.

Is there a way I can SourceTree make remember my password? I do not see a checkbox or an option.

17 answers

1 accepted

This widget could not be displayed.

Hey there,

Questions would be, are you using HTTPS or SSH? Did you add the auth details to your keychain when you authenticate? Did you correctly authenticate? That error (which generally shouldn't appear in later versions of SourceTree as I made improvements to it) is just trying to find the item in the keychain against the remote and username. You could always check your keychain, too.

Cheers

I am using HTTPS. The repo is setup like this:

https://username@dev.some-server.eu/stash/scm/client/mobile.git

How would I add the auth details to my keychain?

What can I check in the keychain? What would I look for?

I think what I did was: I had the repo already on my disk. I then added the existing repo to SourceTree.

Pictures speak a thousand words. Should only take you a minute, hopefully, then it's added there for good. I need to test this myself yet though, which I'll be doing this morning.

Just to clarify, other users are experiencing the same problem. My testing yields nothing because the particular case it happens in doesn't happen for everyone. The next version of SourceTree definitely has a fix for this.

Thanks for your feedback, it led me to the problem :)

This widget could not be displayed.

git config --global credential.helper osxkeychain

This resolved all GitHub password issues for me in SourceTree. Thanks Marnix!

macOS 10.12.3, SourceTree 2.4, & GitHub 2FA

Thanks, fix all my https issues as well!

This bug is still present in latest release...

This solved my problem as well, thanks!

 

It helped me too - all repos using https are working. It still asks for password when your remote url is using SSH but at least something works

Helped me as well. Thanks Marnix!

This one worked for too, thanks!

WORKED LIKE A CHARM. THANKS!!!

Excellent. Thank you. Still corrected my problem in 2018.

Alternatively, manually add these lines to each relevant git config:

[credential]
    helper = osxkeychain

This widget could not be displayed.

It has everything to do with keychain.

1.Go to applications and find keychain access in mac.

2. Search for the keychain for bitbucket.orgor wherever your repo resides

3. Select the keychain that has your credentials for bitbucket. Select to access control tab.

4. Click "+" mark and add sourceTree. This way, the SourceTree has access to the given key chain. Click on allow always when popup appears in SourceTree.

I had to do this when I wanted to clone a repo that used different set of credentials.

This fixed the issue for me. Thanks!

Thanks a lot! That fixed the isse for me as well. :)

This did the trick - thanks :)

This doesn't solve the issue in SourceTree 2.2.4 on Mac OS X El Capitan. I think there's still a bug in the new major version of SourceTree, since downgrading to the previous SourceTree version fixes the issue.

Works! SourceTree Version 2.2.2, El Capitan 10.11.1

Thank you - was looking for a solution for weeks.

This solved it for me - thank you!

Thank you! This solved the issue smile

This widget could not be displayed.

Has anyone ever actually figured out how to get Sourcetree on Mac to start remembering passwords again? It's starting to get pretty old having to retype my password 100 times a day, but none of the solutions I've found posted online have worked so far.

Just started getting this today. Cleared out the 2 Bitbucket entries (1 from the web, 1 for sourcetree) in the keychain and restoring them doesn't change anything. Sourcetree still asks continually and then I get the same error message that @Wei Xia has posted.

Experiencing the same issue the past two days as well. (been offline for a week, so unable to pinpoint when it started.)

This widget could not be displayed.

Running into the same issue with most recent update to Yosemite (10.10) / Sourcetree (2.0.2). 

This widget could not be displayed.

I'm seeing the same issue, still, on SourceTree Version 1.9.4 (1.9.4) and Mac OS X 10.9.3.

Seems to have "suddenly broken", either because of a SourceTree update or system update -- not sure which; but currently the product is unusable.

Tried clearing out any "bitbucket" keychain entries; that didn't help.

Also tried looking in "~/Library/Application Support/SourceTree" (per other posts), but there doesn't seem to be anything in there that's storing credentials, naturally.

Thoughts?

I am still having this issue on 1.9.4.1 has this been fixed yet?

This widget could not be displayed.

Having the same issue: SourceTree (version 1.9.6) cannot remember my password in MacOS X (Maverick). Is this a SourceTree issue or Mac?

This widget could not be displayed.

I'm running SourceTree 1.9.7 on Mac OS 10.9. I was experiencing the same problem, and Tejas' fix above didn't work for me. The IP address of my Stash server changed recently, and I updated the IP address in 'Repository Settings'. Although this worked, I would be prompted twice for my password when attempting to pull or commit, and 'Refresh Remote Status' wasn't working properly. I then read a post elsewhere that suggested to select View --> Show Hosted Repositories, Edit Accounts --> Edit Account, and ensure that the IP address is updated there too. It contained the previous IP address value, and I updated it. Then, when trying to pull, an SSL certificate error appeared. The solution here is to hit the Stash server using Safari (it has to be Safari), and when the certificate warning appears, view the certificate, select 'Always Trust', and save. After that, all operations worked properly from SourceTree, and I am no longer prompted to enter my password.

It might be a good idea to delete any Keychain entries that are present for the Stash server before beginning the process above, just to make sure you're starting fresh.

This widget could not be displayed.

I have a duplicate of this issue here: https://answers.atlassian.com/questions/43716302

Access your repository in the terminal and commit, pull, push etc. This fixed the keychain access issue in SourceTree afterwards.

This worked well for me... 
First had to enable Keychain storage of my passwords:
https://help.github.com/articles/caching-your-github-password-in-git/

This widget could not be displayed.

屏幕快照 2014-11-29 13.40.07.pngWhere I can config keychain? I am using OSX10.10 and sourceTree 2.0.3, and I can not push changes to server.

This widget could not be displayed.

This is still not working in SourceTree 2.1 and OSX El Capitan.

Noticed that sometimes when I try to pull from repository and then I click 'Always allow' for keychain question, bitbucket key in keychain gets deleted!

Even happened that SourceTree won't start. Then I had to manually add key in keychain for bitbucket.

Tried to allow all aplications to access that key, but doesn't help because SourceTree deletes key and writes it again!

This widget could not be displayed.

go to set you General ,chose NetWork change you Username for you Host(github.com).

I also encountered such a problem, the last is such a solution

This widget could not be displayed.

I had this same problem recently. My company migrated from Stash to Bitbucket, so the keychain was storing it as Bitbucket but my repository was pointing at matt@stash. Once I updated the repository settings it started working.

Steps were to go to "Repository" | "Repository Settings" | "Remotes" and edit the path their to say "https://matt@bitbucket.com..." 

This widget could not be displayed.

If you guys have two factor authentication on in github you have to create a token for SourceTree and use it as a password.

This widget could not be displayed.

Was happening all the time on macOS 10.12.5, SourceTree 2.5.2.

Had to go to Keychain Access, remove all (SourceTree) entries (if you search for SourceTree, you'll find "<reopSite> Access Key for <username>").

Thay dated a few months back.

After that, open SourceTree > Preferences > Accounts > Edit (for each account), and enter the passwords again.

It should prompt the Keychain Access popup again, and this time, you should see new entries created. 

This widget could not be displayed.

Finally! Solved this for myself after DAYS of trying every single thing in every possible thread - thanks everyone for providing enough clues for me to get to the bottom of my issue...

So, for me, it seemed to be ONLY my username that was causing the trouble.

In Sourcetree - Preferences - Advanced...

Have a look at what your username is. I had four entries https:gitlab, myusername@gitlab etc, but all the usernames appeared to be my 'display name' at gitlab rather that a 'real' username. So I went to Gitlab to see what it thought my actual username was, and it was actually my full email address, including @ and .com - once I had changed this in preferences\advanced on the https:// account and deleted the rest, I haven't been asked for a password since and all seems right with the world! Best of luck, everyone.

I have been banging my head against this for just one repo for a while. This worked! Thanks so much!

Nice one! Never thought I'd be useful on any git-hub-lab-repository thing, whatever they are! Cheers ;]

This widget could not be displayed.

I hope my answer helps others because I had been struggling with password issues with SourceTree for quite a while and finally figured out the issue. I have SourceTree (2.7.6) on Mac (Sierra 10.12.6) and repo is on TFS. 

I had changed my network/Mac password, that also meant that my tfs repo password was changed too. But this password didn't change on my Keychain Access credentials for tfs. So, I went to Keychain Access and looked for 'tfs' (found two entries). One of them still had my old password. I changed that to my new password and added SourceTree in the AccessControl tab (by clicking '+' at the bottom). Everything works like a charm now :).

Fingres-crossed. 

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

722 views 1 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