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
Community Members
Community Events
Community Groups

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

Bug Fix: Sourcetree for Windows authentication error when updating to app password

Hello Sourcetree users!!! With the recent removal of Bitbucket Cloud account passwords for app passwords (please see our Bitbucket Cloud community post for details on why we made this change for se...

78,806 views 134 29
Read article

Atlassian Community Events