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

GitHub with 2FA - OAuth no longer working

Starting today, I cannot connect to GitHub with my configured OAuth connection.  Every time I try to pull or push it endlessly prompts me for my GitHub credentials, which I supply, but it rejects.  My GitHub account is configured for 2 Factor Authentication (2FA) and it never prompts me for the 2nd code send to my phone, and no code is actually sent to my phone anyway.

All of this should be moot, however, because I am using OAuth and 'SourceTreeForWindows' is set up as an 'Authorized OAuth App' in GitHub.

Things I've Tried:

  • Refresh OAuth Token. Result: seems to be successful but the endless pop-ups prompting me for credentials continues
  • Revoke access for 'SourceTreeForWindows' in GitHub and then Refresh OAuth Token. Result: re-adds 'SourceTreeForWindows' as an authorized OAuth App in GitHub, but the endless pop-ups prompting me for credentials continues
  • 1) Remove all entries for sourcetree and git in 'Manage Windows Credentials', 2) delete all accounts under Options -> Authentication in SourceTree, 3) Uninstall SourceTree from the Control Panel, 4) Completely delete %AppData%/Local/SourceTree and %AppData%/Local/Atlassian folders, 5) revoke 'SourceTreeForWindows' access in GitHub, 6) reinstall SourceTree 2.4.8 from scratch and re-add the OAuth connection to GitHub.  Resultthe endless pop-ups prompting me for credentials continues.  I still cannot pull or push.

What gives? How did it just stop working all of the sudden?

3 answers

I was able to fix it by ditching OAuth.

I removed the OAuth account under Options -> Authentication in SourceTree, then I generated a Personal Access Token in GitHub (under Developer Settings).  Then I added a new GitHub account in SourceTree and selected "Basic" authentication instead of "OAuth" and used the Personal Access Token I previously generated as my password.

That got me all up and running again.

That failed for me.

Worked great for me, thanks! I enabled 2FA in Github, and somehow I messed things up, this post resolved it.

This does not work with the latest Sourcetree

Git just recently deployed a change that disables support for deprecated legacy TLS and SSH algorithms, including those that were used in older versions of some Git clients:


Anyone found solution for this?

I was able to get the SourceTree 2FA dialog to pop up after uninstalling and reinstalling SourceTree a few times, upgrading system Git and rebooting a few times.  Not sure which action fixed the problem of 2FA not displaying but there's a fix in that combination somewhere.

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

5,742 views 4 12
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