Skip to content

Generate Gits’ Personal Access Token

A personal access token (PAT) is a generated string of characters that acts as a password for GitHub API interactions. In this article, we will learn how to generate a Personal Access Token on GitHub.

How to Create a Personal Access Token

Follow the steps given below to create a personal access token:

  • Log in to GitHub: Navigate to GitHub and log in with your account credentials.
  • Access the Tokens Settings:
    • Visit your profile settings directly by clicking this link: GitHub Settings.
    • Scroll down and from the sidebar on the left, click Developer settings.
    • Under “Developer settings”:
      • Click Personal access tokens.
      • Click on Tokens (classic).
    • The Git will prompt you to enter your GitHub password. Enter your Git password to continue.
    • Set up the Token:
      • Give the token a descriptive name in Note. I added “For metaschool”.
      • You can set the expiration to 60 or 90 days or any custom date, you want to.
      • Select repo as the scopes or permissions.
    • Scroll till the end and click Generate token.
    • Copy the Personal access token (PAT): Once the PAT is generated, make sure you copy it and keep it secure. GitHub won’t show the token again. You can use this PAT as a password on the terminal.

    Wrap up

    Awesome, so we learned how to create a personal access token of GitHub which we can use as a password for GitHub API interactions.