Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

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.

20 answers

1 accepted

6 votes
Answer accepted

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.


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

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.

Like mitchellgarrett likes this

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

Like Sangyeob Lee likes this

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

Like Yogendra Ghatpande likes this

Thanks, fix all my https issues as well!

This bug is still present in latest release...

Like Denys B likes this

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!


Thank you! It worked!

Deleted user Aug 09, 2018

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

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

    helper = osxkeychain

Like DNReNTi likes this

Thanks! This solved my issue

many many thanks!

got it in one. strong work.

You're my new god, thanks!

Thanks, it works also on macOS Mojave 10.14.6

Thank you very much! This works for me. After clone code successfully, I use terminal to run this code -> sourcetree password is saved.

That worked for me too.

On a second thought no it didn't. It appeared asking me the password again.

My problem is resolved.

Thanks Marnix!

Worked on macOS Catalina version 10.15.3, Sourcetree version 4.0

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

Thank you so much :) 

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

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

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.


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

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

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.

I have a duplicate of this issue here:

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:

This worked for me

$ git config --global credential.helper osxkeychain

屏幕快照 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 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!

After much testing, it seems this is the only real solution, which works great for me


git config credential.helper store


git pull

provide user-name and password and those details will be remembered later.

This definitely works for me

go to set you General ,chose NetWork change you Username for you Host(

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

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

0 votes
Deleted user Jan 03, 2017

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

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. 

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 ;]

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


nothing worked for me. I removed all accounts from SourceTree, generated new SSH Keys, by following these instructions:

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

4,420 views 4 8
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