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

Adding a second bitbucket account causes credential-nagging popups. Edited

I have 2 bitbucket accounts.  I only recently added the second to sourcetree, and it now nags me to re-enter my credentials at every opportunity (extra note: doesn't tell me which set of credentials to enter).  I tried setting the accounts to use oAuth instead, but it still nags me for credentials.  I also have my SSH key set up for one of the accounts (it won't let me use it for both for some silly reason), added in both my bitbucket profile and pageant, but I assume it's not using it (maybe i need to change the origin on my local repos?) as it's still nagging me for credentials.


Windows 10

1 answer

0 votes
minnsey Atlassian Team Mar 16, 2018


Make sure you are using remote URLs that include your username, e.g.

the Git Credential Manager (GCM) stores credentials keyed on the hostname, e.g., if you have no username it will store the credentials for both accounts under the same key, e.g.,. 

So 50% of the time it will get the wrong creds and delete them. So you have to re-enter.

Using the username in the URL means they are keyed uniquely and should be found correctly.

Hi, thanks for the response.

All origin URLs of my various cloned repos have the relevant username in them, SourceTree looks to have done this automatically already.

There's also no option to change the "Host URL" for Bitbucket in my account settings to include a username, it's greyed out.  I tried changing the "Hosting Service" to "Bitbucket Server", as that's the only option that lets me edit the URL, but it returns a 404 once I put the URL in with my username, so I'm guessing that's for something different.

I've found that using SSH keys for both repos, and switching which key is loaded in Pageant when I want to use a repo on the other account stops the nagging at least.  I tried loading both keys into Pageant at the same time, but the "top" one is just used for both accounts regardless.  I also tried importing the same key to both SourceTree accounts in the web interface, but it refused to let me add it to the second account as I'd already added it to the first.  If either one of those things had worked I'd call this resolved, but I'm still having to swap out keys in Pageant whenever I switch repo which is less than ideal.

minnsey Atlassian Team Mar 20, 2018

Check what entries you have in the Windows Credential Manager?

If you have 2 Bitbucket accounts that you are using via https remote urls I would expect you to see 2 entries of the format




Git should the pick the one that matches the remote url of the repository it is working on.

Do you see the relevant entries?

Wow, I didn't even know Credentials Manager existed!

Ok, here's the results of some experimentation. There were the following 3 entries in there when I started:

git: (no idea where it acquired the www)

I then removed all my repos from SourceTree, removed both my accounts, and this time additionally removed all the entries from Credentials Manager, so I was completely "clean".

Next, I added account 1 to SourceTree, and saw git: appear in Credentials Manager.  I then added account 2 and saw git: appear.  All good so far. 

Then I went to clone a repo from account 1 and got 2 popups asking for credentials (one immediately after the other, while it was checking the git repo).  If I enter my account 1 credentials into both, git: also appears alongside the other 2 accounts.  If I cancel either popup, it removes git: as well as adding git:  If I cancel both popups, it removes git: but doesn't add git:  

I then cloned the repo from account 1, which didn't affect the stored credentials.

Then I went to clone a repo from account 2 and got the same 2 popups, however this time as the popups first appeared they also cleared both git: and git: from Credentials manager.  Previously with account 1, nothing was altered until I'd interacted with a popup.  This time, even if I enter my account 2 credentials into both, only git: gets put back.

I then did a pull on the repo for account 2, it worked fine and didn't prompt me for anything.  I did the same on account 1, it immediately removed ALL the stored "git:" credentials, gave me 1 popup, which I filled in and it put just git: back.  At this point, it's completely removed both my named URLs, and is just prompting me to change the credentials stored in git: whenever I "switch", or at its own intervals, presumably whenever it decides to do a "fetch" on the account not currently stored.

Also maybe of note, when I first added both accounts, it also added the same URLs but with "hg:" and "sourcetree-rest-bitbucket:" at the start instead of "git:" (so added 6 entries in total, 3 for each account).  These then did not get altered throughout my experimentation, but upon removing them within SourceTree's saved passwords after removing both accounts, it would only show 2 passwords at a time while I remove the "git:" and "hg:", and then completely failed to remove either of the "sourcetree-rest-bitbucket:" ones, so I had to remove them from Credentials Manager myself.

This looks like some seriously buggy behaviour.

minnsey Atlassian Team Mar 20, 2018

Thanks for the additional information, I'll have a look,

minnsey Atlassian Team Mar 20, 2018

At the moment I'm not experiencing the same problems you describe using 2 accounts. Can I ask what version of Git and the GCM you are using?

SourceTree says it's using System Git version 2.11.0/LibGitSharp 0.24.0, I have no idea what a GCM is.

minnsey Atlassian Team Mar 23, 2018

Sorry GCM I the Git Credential Manager its an extension that ships with Git for Windows and manages the authentication.

Please upgrade your Git installation to v2.15+.

You can do this in Sourcetree by using the update embedded git option in the Tools/Options/Git tab. 

Or you can install git from (2.16+) and switch to using System Git in Tools/Options/Git tab

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,377 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