GitHub Personal Access Tokens (PATs) are used to authenticate and authorize access to your GitHub account. This guide will walk you through the steps to obtain a PAT for use with applications and scripts.
-
Log In to GitHub
- Go to GitHub and log in to your account.
-
Navigate to Settings
- In the top-right corner of the page, click your profile picture, then select Settings from the dropdown menu.
-
Access Developer Settings
- On the left sidebar, scroll down and click Developer settings.
-
Go to Personal Access Tokens
- Click Personal access tokens in the left sidebar.
-
Generate a New Token
- Click the Generate new token button.
-
Set Token Description and Expiration
- Provide a Note (description) for your token. This helps you remember what the token is used for.
- Set an expiration for the token if desired. Tokens with an expiration are more secure.
-
Select Scopes and Permissions
- Choose the scopes and permissions for your token based on the actions you want to perform. Common scopes include:
- repo: Full control of private repositories
- read:org: Read-only access to organization information
- For more detailed information on scopes, refer to GitHub’s documentation.
- Choose the scopes and permissions for your token based on the actions you want to perform. Common scopes include:
-
Generate and Copy the Token
- Click Generate token at the bottom of the page.
- Important: Copy the generated token and store it securely. You will not be able to see it again after leaving the page.
-
Use the Token
- Use your new token in your applications, scripts, or wherever authentication is required.
- Keep Your Token Secure: Treat your token like a password. Do not share it or expose it in public repositories.
- Use Environment Variables: Store tokens in environment variables rather than hard-coding them into your applications.
- Regenerate Tokens Regularly: Periodically regenerate tokens and update your applications accordingly.
- Revoke Compromised Tokens: If you believe your token has been compromised, revoke it immediately from the Personal access tokens page.
Please remember that this application does not store any tokens. Your token is used temporarily during operations and is not saved in any form. Ensure you handle your token securely and do not share it.
If you want to contribute to this project, you are more than welcome! Feel free to submit issues, pull requests, or suggestions. Your contributions help improve the project for everyone.
For more information on contributing, please refer to our contribution guidelines (link to contribution guidelines if available).
For more information on GitHub Personal Access Tokens, check out the GitHub documentation.