Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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 do I convince SourceTree to store my password in my keychain? Edited

Using ST v2.5.1 on Mac OS 10.12.5 connecting to a private git server through ssh. Every operation to/from the server requires I enter my password in the pop-up dialog, twice. I have read through all the support articles I can find and none of the solutions/work-rounds work for me. 

The remote URL is of the form myuser@myserver.tld:path/to/origin

I have tried embedded Git and switched ST to use System Git (2.13).Same behaviour using both.

I have carried out push/pull operations in Terminal

I have run ssh-keygen to create new keys

I have created an 'account' for the private URL and enterd my ssh credentials

I have set git config --global credential.helper osxkeychain in terminal

I have checked my keychain and there is no record for ST at the URL of the server. As there is no record I cannot set its permissions (one of the other things I have seen that worked for other people)

Does anyone have any other ideas? Atlassian even suggested that v2.5.x would fix this problem, but not it seems, for me.

4 answers

1 vote
jyo Atlassian Team May 25, 2017

Hi Mark,

With 10.12, I believe there is something you can update a setting to include the Keychain:

Also, can you check you SSH config to see if it is pointing to the correct keyfile? (see:

I should also note that if you're not using Bitbucket Server, you shouldn't add the account under "Preferences > Accounts"



0 votes
Manju Atlassian Team May 25, 2017

Can you please check your ssh config file once and see if that's fine. And for your kind info, there are new keys on macOS 10.12 to remember password and get the ssh agent use the key -



Thanks for the quick responses guys. I followed technote 2449, added UseKeychain yes and AddKeysToAgent yes. Made no difference.

I verified the agent is running.

I tried the steps to create an identity in ~/.ssh/config for the url I am trying to login to. Again saving the UseKeychain etc but ST still refuses (or is being refused) to place an item in the keychain.

And yes I quit ST and started again after each step of changes to ensure that it was using the latest ssh config

Anything else to try?

jyo Atlassian Team May 25, 2017

Can you try restarting the SSH service?

sudo launchctl stop com.openssh.sshd

(it should automatically restart)

What I've done with success :

open in hom dir  ~/.gitconfig , and add :

[credential "https://domaint.private.server"]
username =
helper = store

one for each server !

I have tried all the techniques all the helpful people here have suggested and it still does not put anything into the keychain. I uninstalled the app, switched to the admin user, downloaded another copy, installled that and it DOES put an entry in the keychain and only asks for the password once. So I switched back to my user account, installed a fresh copy of ST and was ever hopeful it would work. It did not. 


So my conclusion is this is a permissions issue rather than any kind of unique git setup. Why does ST when running in my user account not store details in my keychain but an admin user does?

I also tried a different approach, but it only highlights what I believe is the root cause: I tried to clone a new repo. When entering the url I deliberately left off the username part of the url. ST correctly asks me for the authentication details. I entered the username and password. Store Password in Keychain was ticked. After entering the details, it came back to ask me for it all again. This repeated many times until I got bored and clicked cancel instead.

This confirms to me it is a permissions issue with ST negotiating with the keychain incorrectly. Is this fixable?

Hi Mark,

I encountered almost the same problem as you. The symptoms appeared when I used a Windows version SourceTree to update the repository and I thought I'd screwed up the repository because of the CRLF issue. However, I had another Mac that works very well with the repository. On the Mac that has the problem, I notice that the password with key name "<git server IP> Access Key for <user ID>" was missing. So, I tried to manually create that key but seems I cannot update the "Where" field to "SourceTree". Then, I deleted all password keys for that GIT server in the Keychain, uninstall and SourceTree again, the problem then solved. Now the password key "<git server IP> Access Key for <user ID>" appear again. Hope this help.

Thanks. It is now fixed. The important thing that finally solved this was the fact that the keychain had an entry I had not expected. There was an entry for the numerical IP eg as well as its domain name eg Once I had cleared the numerical address, SourceTree would create one for the domain address. There's two months of my life I won't get back. But thanks to Joseph, I have now at least got over the password not saving problem.

This is a brutal thread - 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.

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

3,334 views 4 5
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