๐ How to Generate a GitHub Personal Access Token (PAT)
Follow these steps to create a GitHub Personal Access Token (PAT) to use for authentication with Git or other tools:
Wiki topics:
๐ ยท Open Source
๐ How to Generate a GitHub Personal Access Token (PAT)

Follow these steps to create a GitHub Personal Access Token (PAT) to use for authentication with Git or other tools:
1. ๐ Log in to GitHub:
- Go to GitHub and log in to your account.
2. โ๏ธ Access Developer Settings:
- In the upper-right corner of any GitHub page, click your profile picture.
- Select Settings from the dropdown.
- Scroll down and, on the left sidebar, click Developer settings.
3. ๐ Generate a Personal Access Token:
- In Developer settings, select Personal access tokens from the sidebar.
- Click on Tokens (classic) and then click Generate new token.
- Generate New Token (Classic)
- Give the token a descriptive name, such as โGit CLI Tokenโ, so you can remember why you created it.
4. ๐ Select Scopes and Permissions:
- Choose the scopes or permissions to grant this token. For full access to repositories (push, pull, etc.), select the
reposcope. - You may also want to choose
workflowfor GitHub Actions oradmin:repo_hookfor repository webhooks. - If you only need specific permissions, select the minimum necessary scopes for better security.
5. โก Generate the Token:
- After selecting your desired scopes, click Generate token at the bottom of the page.
6. ๐ Copy the Token:
- Important: Once the token is generated, copy it immediately. You wonโt be able to view the token again after you leave the page.
7. ๐ก Store the Token Safely:
- Save the token in a secure location, like a password manager.
- Use this token instead of your password when performing operations like pushing or pulling from a GitHub repository.
๐งโ๐ป Using the Token with Git:
When prompted for a username and password during Git operations, use:
- Username: Your GitHub username.
- Password: Paste your newly generated PAT.
Example during git push or git pull:
shell
Username: your-github-username
Password: your-access-token ๋ฉํ๋ฐ์ดํฐ
- post_id
- ff71a48bdfd2
- slug
- how-to-generate-a-github-personal-access-token-pat-ff71a48bdfd2
- url
- https://medium.com/@Warner_Bell/how-to-generate-a-github-personal-access-token-pat-ff71a48bdfd2
- canonical_url
- https://medium.com/@Warner_Bell/how-to-generate-a-github-personal-access-token-pat-ff71a48bdfd2
- author_url
- https://medium.com/@Warner_Bell
- status
- ok
- fetched_at
- 2026-07-14 15:00:07