Switching To Githubs New Personal Access Token Authentication

Switching To Githubs New Personal Access Token Authentication

Git has recently announced that at the beginning August 13, 2021, they will no longer accept account passwords when authenticating Git operations on GitHub.com.

Panic sets in!!!!!!

Don’t panic its pretty easy. You can read up about the updates here. https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/

I needed to setup a new repo and had to do it with the new token based auth.

First you need to generate a token to use head to this link.

https://github.com/settings/tokens

Click generate token.

You will then be asked to allow specific permissions for the token this is actually a really good thing for security its similar to how AWS adds IAM permissions.

Below is a screengrab of the basic permissions needed for a token to update a repo.

This will now give you a token to use.

If you have already added a remote the old way you will need to remove it first.

git remote remove origin

You can then add your new remote that includes your key we with following method.

git remote add origin https://samueleastdev:ghp_00000000000000000000000000@github.com/samueleastdev/videojs-dash-hls-bitrate-switcher.git

Make sure you add your token and username in the correct places you can then continue normal operations.

Leave a comment

Your email address will not be published. Required fields are marked *