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

Connect SourceTree to 2-factor enabled GitHub

Plase provide a detailed summary of how to connect SourceTree to 2-factor enabled GitHub.

2 answers

1 accepted

I finally made it work.  I will try to summarize as best I can for others needing SourceTree to connect to GIT using 2-factor authentication (2FA):

  1. SourceTree: Tools > Options > Authentication:  Delete as many password accounts as you are able to delete.  Try deleting at least twice for those accounts that are hard to delete.

  2. Close SourceTree.

  3. Windows: Enter Control Panel > User Accounts > Manage Windows Credentials.  Delete all "Git-look-alike" credentials, i.e. the credentials in SourceTree: Tools > Options > Authentication that you were not able to delete.

  4. GitHub:  Set up 2FA.  I used SMS-verification.  Google a bit and you will find a guide.  This step was quite straight-forward.

  5. GitHub:  Create a token: Log in to GitHub, press user drop down arrow at upper right corner, choose 'Settings', choose 'Developer settings', choose 'Personal access tokens', choose 'Generate new token'.  I gave the new token access rights to everything.  Save the token.  My token was a string consisting of 40 characters.

  6. SourceTree: Clear all saved password:  Windows: Go to C:\Users\USERNAME\AppData\Local\Atlassian\SourceTree and remove the 'passwd' file.  The purpose of this step, is to force SourceTree to ask for password in next step.

  7. SourceTree: Open SourceTree and do a Pull Request. SourceTree will now ask for password.  Use the token from (5) as password.
Charlie Misonne Community Leader Jul 09, 2021

I'm glad you sorted it out and thanks for documenting the steps for other community members!

You can mark your own answser as accepted if you want to.

Hi again,

I read your post while answering your other one.

I haven't used SourceTree myself since a while. But I found this article in the documentation: Two-Factor Authentication (2FA) with GitHub in SourceTree 

The article says: "For versions earlier than SourceTree 2.4 for Mac and SourceTree 1.10 for Windows." SO I'm not sure if it will be of any help.
But I hope it points you in the right direction.


I found the information for recent versions.

Apparenltly newer versions support the Windows Credential Manager which supports 2FA.
So you'll need to use that tool.
See more on SourceTree for Windows 1.10.0-* authentication and accounts updates 

Thanks for answering.  Before installing a new password manager, i tried

But, unfortunatively, SourceTree seems to be extremely buggy in its Tools > Options > Authentication window:

  • NOT WORKING: Deletion of any password account set as "default account".
  • NOT WORKING: Editing any password account set as "default account".  (If trying to edit, the current passord account is not changed, but a new password account is created).
  • UNSTABLE:  Deleting password account not set as default account.  (Seems to me as if the *second* attempt to delete account normally works).


  • If a new password account is created, I am not able to set it as default. 

As far as I can see, this effectively means that it is impossible to edit a default password account(!)


I am using latest SourceTree version 3.4.5.

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

61,350 views 127 27
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