SourceTree and GitHub: please use a personal access token instead

On a new computer, I was not able to clone and access my GitHub projects with SourceTree. Instead, there was always the error message that I need to use a personal access token.

I searched the internet and found a lot of other people struggling with the same error message. Interesting enough, the basic authentication was still working on my other computer.

The problem

The issue started when I wanted to clone a repo. SourceTree would just tell me that the URL is not valid.

This is not valid source path / URL

Looking in the details, the usage of a personal access token is the way to go now.

Error: remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: Authentication failed for

What I tried and did not work

I tried a lot of stuff I found on the internet. I generated a personal access token. It is often stated to use the token as password, however, this did not work. I also tried to set up the account as OAuth, this seemed to work but resulted in the same error message.

The solution

After I have been pissed off enough, I decided to use SSH. In order to do that, you have to create a SSH key pair. SourceTree installs “puttygen.exe”. You can find it in the installation folder.

C:\Users\da\AppData\Local\SourceTree\app-3.4.6\tools\putty

I generated a key, saved the private key to a file and copied the public key to the clipboard.

Now the public key needs to be added to GitHub. This can be done in the settings.

Enter a name and paste the key.

Now the private key needs to be set in the SSH Client Configuration section.

After that I was able to clone the repos using the SSH link.

Leave a Reply

Your email address will not be published.