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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,462,867
Community Members
 
Community Events
176
Community Groups

How to add more than one Github account to sourcetree

Edited

Lateley I have a lot of problems with having more than one github account in sourcetree. I am using two github accounts (one private one for work) and one Bitbucket account. 

I am using ssh to connect to the accounts. Where Bitbucket is working fine, and depending on which github account I add first, One github account seems to work OK, it will not show the repositories. The other account shows all repositories but is not able to download any because it somehow looks at the account I added first. 

I have tried several things, for fixing this. 
I first started out with a fresh install of sourcetree (mac) and a new set of SSH keys. 
Then adding the accounts but this did not help.

Then I set up a personal access token to one of the github accounts and started to use the basic auth type and not OAuth this did not help either.

I also saw that sourcetree does not allow you to select your own SSH key, and keeps on using the wrong one. I moved the one it found so it could not find it anymore. 
Hoping it would find the correct file, but now it cannot find the other file which is added to GitHub. So I generated a new one in Sourcetree and added it to GitHub. 

This did not work either, cloning a repository from this account still gets confused with the wrong login. 

Errors found are:

ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
ERROR: Repository not found.
fatal: Could not read from remote repository.

 

Please make sure you have the correct access rights
and the repository exists.
origin git@github.com:*/*.git (fetch)   // note this is the wrong account 



I am out of idea's and starting to believe I should not be using sourcetree anymore.
It is at least too much time consuming to be bothered by it every time. 

I hope somebody has a good solution for this, as the interface is easy and helpful

 

 

UPDATE: 
It also seems like it, that Sourcetree is having some sort of cache.
After I added a new ssh file to Github, removing the old one from the config file in the .ssh directory and removing the ssh file from the .ssh directory it still seems to want to add that specific ssh file. 

I removed Sourcetree all together, also removing files that where associated with it. 
After reinstalling, it still seemed to have my account data in there. 
So far for a 'clean' install. 
Thus I followed these steps: https://community.atlassian.com/t5/Sourcetree-questions/How-do-I-fully-remove-SourceTree-so-that-I-can-do-a-quot-fresh/qaq-p/605355

After reinstalling still the same 'wrong' ssh keys where found and used by sourcetree.
The worst part is, that I cannot set my own SSH file. I cannot choose it. Sourcertree just tells me that I need that file (somewhat frustrating). 

So I am trying again, but now with rebooting my computer after removing all files. 

 

4 answers

1 accepted

0 votes
Answer accepted

After removing and re-installing several times the problems are still there. 
As it seems nobody has answer it looks like I need to start working with another application. 

Hi,

This not an answer as I am also having this problem of trying to add multiple SSH-based BitBucket accounts.

It looks like SourceTree only looks at the default `id_rsa` file pair in `~/.ssh`.

SourceTree doesn't appear to be reading the `~/.ssh/config` file for the `IdentityFile` parameter for the corresponding `Host`.

We need some way to associate the correct id_rsa file pair with the corresponding account.

Hi,

When you're cloning the projects from two GitHub accounts, you also need to map those accounts in the Sourcetree before cloning the repository. Once you clone the repo from account 1, switch to the another account and then clone from account 2. 

It also seems like it, that Sourcetree is having some sort of cache.
After I added a new ssh file to Github, removing the old one from the config file in the .ssh directory and removing the ssh file from the .ssh directory it still seems to want to add that specific ssh file. 

I removed Sourcetree all together, also removing files that where associated with it. 
After reinstalling, it still seemed to have my account data in there. 
So far for a 'clean' install. 
Thus I followed these steps: https://community.atlassian.com/t5/Sourcetree-questions/How-do-I-fully-remove-SourceTree-so-that-I-can-do-a-quot-fresh/qaq-p/605355

After reinstalling still the same 'wrong' ssh keys where found and used by sourcetree.
The worst part is, that I cannot set my own SSH file. I cannot choose it. Sourcertree just tells me that I need that file (somewhat frustrating). 

So I am trying again, but now with rebooting my computer after removing all files. 

 

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events