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

Multiple GitHub & BitBucket accounts - multiple SSH keys howto? (MacOSX 10.13)

So problem:

I have multiple accounts (several work/clients, personal) on both BitBucket and GitHub.

I have sorted that mess out using hostnames like client1-github, client2-github, work-github and personal-github in my ~/.ssh/config file, each then points to the correct SSH key (No, you can't use the same SSH key for multiple accounts, and I can't use the same work account on some clients as they want the accounts). I also am a bit stuck in NOT using the HTTPS methods as that involves passwords on the commandline for the repos which I need to avoid

The problem now is that SourceTree doens't pick that up, or write SSH keys so now it displays warnings and can't "connect" to previously connected gitHub/BitBucket accounts.

Is there a way to tell SourceTree
1) Which Key to use/point to for an specific GitHub/BitBucket account?
2) to spefify the SSH/git hostname to be used for GitHub/GitLab/BitBuccket for the SSH connections to be made via ~/.ssh/config?

Seems that SourceTree is very specifically made only for a user(s) that have a single GitHub/Bitbucket account ;(

1 answer

0 votes
Manju Atlassian Team Mar 07, 2019

One way is to generate ssh keys from sourcetree itself to have it write the config with the right keys.

Do I then have to generate these keys on EACH computer I have the multiple accounts and have the plethora of SSH keys then in BitBucket/GitHub/etc?

It still seems to fail when adding the 2nd/3rd/4th SSH key for the next account as it doesn't seem to have a distinction in the ~/.ssh/config as it uses the same git@bitbucket/git@github , just the extra keys, thus it again fails ;(

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

7,094 views 5 13
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