A Personal Access Token (PAT) allows you to authenticate to GitHub and perform tasks from scripts, Git clients, or applications without using your password. Follow the steps below to create a Personal Access Token.
Step 1: Sign in to GitHub
- Go to GitHub and log in to your account.
- In the upper-right corner of any page, click your profile photo, then click Settings.
Step 2: Navigate to Developer Settings
- In the left sidebar, click Developer settings.
- Click Personal access tokens, then click Tokens (classic).
Step 3: Generate a New Token
- Click Generate new token.
- Choose Personal Access Token (classic).
Step 4: Configure the Token
- Note: Provide a meaningful Note to identify this token (e.g., “My WordPress Integration”).
- Expiration: Select the expiration period for the token. For security reasons, it’s recommended to avoid “No expiration.”
- Scopes: Select the scopes or permissions you want to grant. Some common scopes include:
repo– Full control of private repositoriesworkflow– Update GitHub Actions workflowsread:org– Read organization and team membership
Choose only the permissions required for your tasks.
Step 5: Generate the Token
- Scroll down and click Generate token.
- GitHub will display the token once. Copy it now and store it securely. You won’t be able to view it again.
Step 6: Use Your Token
- Use your Personal Access Token instead of a password when authenticating with GitHub in scripts, Git clients, or applications.
- Keep it secure. Do not share it in public repositories or posts.
Step 7: Revoke or Delete Tokens
- To revoke a token, go to Settings > Developer settings > Personal access tokens > Tokens (classic).
- Click Delete or Revoke next to the token you no longer need.