How to Generate a personal Access Token on Github?

Github has removed password authentication on August 13, 2021. Therefore, you'll need to use a personal access token to do operations on Github. In this tutorial, we will show you how to generate a personal access token and use it instead of your password on Github.

To generate a personal access token on Github, do the following:

  1. Login into your Github account at https://github.com.
  2. Go to your Github profile account (top right corner), go to Settings -> Developer Settings -> Personal Access Token -> Generate New Token -> Choose permissions for your access token -> Click Generate Token -> Keep the generated token some where safe.
  3. Your generated access token will look like this gsk_hNs38H0ufopK3zPamGqPyMkmgNq5cb3C0CNF

  4. Now, use this access token instead of your password to pull, push or to do other operations on github.
  5. Example:
    git push origin main
    Username for 'https://github.com': user@example.com
    Password for 'https://user@example.com@github.com': your personal access token here