The fastest way to get GitHub and SourceTree to play nice

Connecting Mac SourceTree with your GitHub account

Edwin Klesman
3 min readMar 9, 2021


In this post I will show you how to setup and/or fix the Mac OS version of SourceTree to make it work with your GitHub account like a charm.


  • Delete the Github authentication files under Home > Library > Application Support > Sourcetree
  • Restart SourceTree
  • Setup your GitHub Account using oAuth

It stopped working

Don’t you hate it when you’ve done some very nice programming that implemented that awesome new feature or fixed an annoying bug that caused a crash of your app?

Especially when it’s late, and you’re like: “let me just commit this version so I can go to bed sleeping like a rose as my code is committed and safe from harm”.

That dream was crushed as recently, I couldn’t commit from SourceTree to a GitHub repository I was working on after a sweet bug fixing session for a client’s app.

Whatever I tried or did, Sourcetree kept on barking at me with a nice red commit failed error:

“Invalid username or password”

The credentials seemed to be done for. And I just couldn’t get them working quickly.

Cleaning up the password mess

If you are setting up a fresh connection from your SourceTree app with your GitHub account, and you never did this before on your current Mac, you can skip this chapter.

I tried removing my GitHub account under Preferences > Accounts, and using a Personal Access Token that I did setup under my Github account’s Token page.

Nade. Nope. Nothing.

Then I tried reconnecting using a new oAuth account item.

Still no dice.



Edwin Klesman

Team lead @Detacom | cross-platform | mobile & web dev | Product Development | SaaS | your guide from app ideas to realization | Owner

Recommended from Medium


See more recommendations