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

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


1 badge earned


Participate in fun challenges

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


Gift kudos to your peers

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


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!


Cannot connect to GitHub with 2FA / SSH using SourceTree 3.0

I'm trying to setup sourcetree 3 on a new Mac. I already had my SSH key created and added to GitHub prior to installing SourceTree. When i go into the accounts section in sourcetree and try to add my GitHub account with SSH, I get a message during the "connect" phase that says "There was a problem adding your new SSH key to your GitHub account". GitHub doesn't allow adding the same key twice so i tried removing it on their end but it still didn't help. I get the same message. Obviously source tree won't let me pull because of credentials errors. This was really easy with Personal Access tokens in SourceTree 2...what can I try in SourceTree 3 to get this to connect?


2 answers

2 votes
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Dec 18, 2018

You can login to GitHub on Sourcetree using OAuth and post that use either your own ssh key or a new ssh key generated from Sourcetree. If this key isn't already present on the host, it will be uploaded to GitHub by Sourcetree. 

Lastly, Please check if the ssh-agent has your keys loaded. If not, please add them to the agent. 

Run below commands in terminal to do so,

To check if keys are loaded:

ssh-add -l

To add keys to agent:

ssh-add <path_to_key>

more like,

ssh-add ~/.ssh/id_rsa

Key in the passphrase used while generating the ssh key and you should be good to go.

Thanks Manjunath,

For some reason my ssh key was not added to the agent. I thought this had been done. I added it successfully but it still doesnt fix the issue. I get authentication errors if a try to pull from my remote repo and if i go into the accounts panel and connect with github using my I get the same error saying "There was a problem adding your new SSH key to your GitHub account". I assume the error with adding the new key is because the key already exists on GitHub but if i delete the SSH key on GitHub, SourceTree still reports that there is an error adding it. So i do what it says and add it manually but still get nothing.

Like # people like this

For the record, having SourceTree generate a key gives the same error about being unable to add it to github.

Like Peter Campbell likes this

Hi Jason,

I am also facing same issue as yours.

Did you get any solution to this problem?

Make sure the origin is not using https and its just git@github SSH option. Had the same issue and at some point it made a weird switch.

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events