Technology3 min read

How to set up HTTPS Personal Access Tokens for GitHub Authentication

Abhishek Ahlawat

By Abhishek Ahlawat — JULY 28, 2022

Founder of StudyTonight and a MERN fullstack developer. Writes about JavaScript, web development, Linux, and tech.

#https#github#howto

Summarize this article using AI

What are PATs?

PATs are the Personal Access tokens or GitHub Access Tokens that are strings of non-human-readable characters. These Github access tokens are used for the authentication of a user. PAT has replaced the method of old password-based authentication.

Instead of typing in your password for Git, you will enter your GitHub Access token. You can also choose to cache the token forever, so you don’t have to enter it all the time.

So Let's see -

How to set up github Access token

How a GitHub Access Token is Generated?

  1. In order to create a GitHub Access Token, you'll need to verify your email address.
  2. In the upper-right corner, click on your profile photo and then the settings button

    Developer Setting, GitHub Access token

  3. There you will see Developer Settings, Click on it.
  4. Then in the left-sidebar, Click on personal Access Tokens and Click on Generate New Button.
  5. You need to give a name to your token.

    name of Github access token

  6. Alright Now, Set an Expiration date for your token. You can select from the default time period or you can use the calendar picker.

    Github access token expiration date

  7. Finally, you have to choose the scope of this token. This will allow or disallow certain actions.

    repo github access token

  8. Now click on Generate Token.

    generate PAT

The token will look like this -

ghp_cgq4ZrHmFu0lLPl7ajKAwgMPnT5zhF00000

Note: Make sure to not share this token with anyone, it works as your password.

Set Up GitHub Access Token

  • For Windows - If you are using native Git then you can open the "Manage Windows Credentials" from the Control Panel and can edit or add this token to git:https://github.com.
  • For macOS - You can use the Keychain Access app. You will need to search for github.com and find the internet password and then you can change the key

Conclusion

Now, you are able to create your own GitHub Access Token or PAT.

Spotted something outdated or wrong?

Liked this? See more StudyTonight posts in Google results.

Add StudyTonight as a preferred source
Next questLIVE OPSStep 2 / 3

Practice real incidents in the browser

System Design Ops — put out fires, ship fixes, and stack XP. Reading done. Time to play.

Play System Design
  • +XP

    Every sim

  • Incidents

    Live ops

  • Ranks

    Climb up

Read next