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

How do I convince SourceTree to store my password in my keychain?

mark fleming May 25, 2017

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
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
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
adamrackishotmail December 14, 2018

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.

Anand Kumar August 7, 2019

This worked.

0 votes
Riccardo Cohen May 26, 2017

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 !

mark fleming May 27, 2017

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?

mark fleming May 27, 2017

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?

Joseph Hui June 22, 2017

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.

mark fleming June 27, 2017

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.

0 votes
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
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 -



mark fleming May 25, 2017

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?

Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 25, 2017

Can you try restarting the SSH service?

sudo launchctl stop com.openssh.sshd

(it should automatically restart)

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events