How to create a personal access token (PAT) in GITHUB
You need to create personal access tokens to use in place of a password with the command line or with the API. As a security precaution, GitHub automatically removes personal access tokens that haven't been used in a year.
Create a token
1. In the upper-right corner of any page, click your profile photo, then click Settings.
3. In the left sidebar, click Personal access tokens.4. Click Generate new token.
6. Select the scopes, or permissions, you'd like to grant this token and Click Generate token.
GIT PAT scopes |
Your Token should look like this.
Using a token on the command line
Once you have a token, you can enter it instead of your password when performing Git operations over HTTPS.
For example, on the command line you would enter the following:
$ git clone https://github.com/username/repo.git
Username: your_username
Password: your_token
No comments