Skip to content

Setting up Personal Access Token with GIT / Github

Posted on:August 31, 2021 at 07:53 PM

So Github requires now a new way to Authenticate yourself to execute github actions. (More info can be found on Github Blog )

Essentially you can not use your Basic Authentication anymore as in your Github username and password for executing git actions. So here I’m to offer an alternative. Not SSH alternative, since I’m too lazy to set that up on every machine, I will show a quick and easy way to never need to enter credentials without the need to use SSH keys.

Getting a PAT

Setting up the PAT Authentication

Now, what we have to do is to do a git pull or git push in the repository we have where we will get the git prompt to enter the username and password. However, we will cancel this and instead we will write

git config --global credential.helper cache

This will save our next prompt for username and password (in our case our PAT) and we will not need to enter it again. So after execting this command we just git pull / push and the prompt should appear again. Enter our github username and our PAT as password and this is it. Until the the token expires we have our credentials set.

Hopefully this guide was helpfull!

If you want more small tips and cool links you can always subscribe to my Newsletter