Have been connecting to GitHub using SourceTree for over 1 year but now cannot get access
Asked by Chris Hadfield:

Have just upgraded to SourceTree 2.4.8 because GitHub support suggested this but still unable to connect to my repository to do a Push.

GitHub login comes up but whatever I try in terms of configuring SourceTree to use the access token I've generated for GitHub I get auth failure, and even though the Refresh Auth Token from SorceTree shows as success?


Answers:
author: invocation
body: same here on my mac...

I updated sourcetree yesterday and i can not push to github anymore. the dialog is comming up with his command to push but nothing happens (it hangs and has no further output). i can push from command line. I try to follow all advices here but nothing works... but sourcetree refreshes after i have pushed on cmd line...

any further hints?


author: Mike Corsaro
body: Hello! Could you provide more details about where the error appears? If you're using an access token from GitHub, then you should be using that as a replacement for your password and won't need to add the remote account.

comments: author: Mike Corsaro
body: If that doesn't work, try adding the GitHub account with OAuth:

* Options \> Accounts
* Add a new account, but set "Authentication" to "OAuth"
* Login, switch back to Sourcetree
* Try pulling again


author: Chris Hadfield
body: Thanks for your prompt answer Mike. I've been getting feedback from GitHub support on this. The frustrating thing is that I can do a push fine from command line using my GitHub credentials but cannot using latest version of SourceTree!

GitHub support tell me that they have done some work on TSL and SSH recently and they comment:

\>\>The HTTPS request error you're seeing there is related to our recent TLS deprecation. Could you try connecting via SSH in SourceTree? If that doesn't help, I recommend you reach out to SourceTree's support team about how to use their tool with TLSv1.2.

And:

SourceTree comes with an older version of the Git Credential Manager for Windows built in. This is one of the known incompatibilities:

<https://githubengineering.com/crypto-removal-notice/#known-incompatible-clients>

It's not possible to directly upgrade the version that SourceTree uses, though you may be able to find a workaround in their forums.


author: Mike Corsaro
body: Okay, got it. To help fix this:

* Download Git for Windows from the git-scm website
* Install
* Open Sourcetree, Tools \> Options \> Git, and click "use system git"
* This will tell Sourcetree to use the version of git you just installed, and a newer GCM
* Additionally, in Tools \> Options \> Network
  * Check the "Enable TLS 1.2" checkbox


author: Chris Hadfield
body: OK thanks again for your help Mike.

I tried this but still not able to push through SourceTree - a GitHub Login modal appears when I try to Push and when I enter credentials I get the same error as before - see attached screen shot.

I can still do the push OK from cmd line after doing the commit in SourceTree. Again the GitHub modal opens and I enter the same creds - username and latest and latest generated auth token - and it works fine. SourceTree then take a while to catch up and realize that the push has gone through.![SourceTreeShenanigans.png](https://community.atlassian.com/t5/image/serverpage/image-id/15805i4C8E1A81E882D2B2/image-size/large?v=v2&px=999 "SourceTreeShenanigans.png")


author: Mike Corsaro
body: Hello! Sorry for the misleading answers -- it turns out this is caused by a TLS change on Github's side so the Git Credential Manager no longer works with Github unless you're using the version released last month.

To fix this:

* Download the latest git for windows
* Open Sourcetree \> Options \> Git \> Use System Git


author: Chris Hadfield
body: OK Mike:

YES I've already done these two things. Should I uncheck for:

Additionally, in Tools \> Options \> Network

* Check the "Enable TLS 1.2" checkbox?![SourceTreeShenanigans2.png](https://community.atlassian.com/t5/image/serverpage/image-id/15817i25AE8CCD5419FE1B/image-size/large?v=v2&px=999 "SourceTreeShenanigans2.png")


author: Mike Corsaro
body: Okay, so now you'll want to make use you hit the "Use System Git" button, and then under "Network" enable TLS 1.1 and 1.2


author: Chris Hadfield
body: OK did this but still no able to push?


Tags: github