Create a GitHub Personal Access Token example

How to generate GitHub personal access token

If you ask me, GitHub’s removal of support for password authentication on August 13, 2021 was a bit of an overstep. But fortunately, it’s not overly difficult to create and use a GitHub personal access token instead. Just generate the personal access token in GitHub, and provide the token whenever Git prompts for your password.

generate github personal access token

The link to create a GitHub Personal Access Token is found under ‘Developer Settings’ in the admin console.

Steps to create a GitHub personal access token

To create a personal access token in GitHub, follow these steps:

  1. Log into the online administrative console.
  2. Under your GitHub user profile (not the repository profile), click the “Settings” link.
  3. Scroll down and click the “Developer Settings” link.
  4. Click the GitHub “Personal access tokens” link.
  5. Click the “Generate new token” link and provide your password again if required.
  6. Provide a name for the GitHub personal access token in the “Note” field.
  7. Set the access token’s expiration timeout to “No expiration.”
  8. Click the checkbox for every permission scope to give your GitHub token full repository access.
  9. Click “Generate token.”
  10. Copy the GitHub Personal Access Token and use this as the password when you do a Git push.
GitHub Personal Access Token Fix

If you try to push to GitHub, you are told you need a personal access token.

How to use a GitHub personal access token?

The GitHub personal access token replaces your password. Any operation like a Git push that requires credentials prompts you for your username and password.

For the username, simply provide your GitHub account name.

For the password, provide your GitHub personal access token.

How to push with a GitHub access token?

The first time you perform a push to GitHub, you are prompted for your username and password. Simply provide your GitHub username and the access token and your files are uploaded to GitHub.

Push with GitHub personal access tokens

Use your GitHub personal access token as your password when you perform a git push to GitHub operation.

 

If you use Windows, your old credentials may be stored in the Windows Credentials Manager. Open this service, look for the web credential used by Git and delete it. Then perform a new push to GitHub.

The next time you perform a push with a GitHub personal access token, the new token will be stored by Windows. You won’t need to remember the value of the GitHub token on future Git push operations.

 

 

 

SearchAppArchitecture
SearchSoftwareQuality
SearchCloudComputing
SearchSecurity
SearchAWS
Close