On Dec. 15, 2020, GitHub released a post talking about they won’t accept account passwords for authenticating Git oprations on GitHub after Aug. 13, 2021.  As a consequences, GitHub provides the following two methods for authentication:
- A personal access token over HTTPS.
- SSH key over SSH.
As a person perfer using HTTPS (I switch working computer frequently, for instance, I use one computer at my workspace, and use another computer at home). What’s more GitHub recommends HTTPS method because of these reasons:
- SSH key, when being stolen, will cause a huge problem. Not only replacing it is cumbersome, but also may let you cannot use the service for a while or permenantly for the reason of all authentication rely on SSH key. It your SSH key is stolen and you don’t have other authentication methods, then you have to contact the adminstrator or even you can’t login the service forever (such as AWS EC2 machine).
- Some firewalls in your organization will block SSH connections. For security reasons, some companies block SSH connections, but they usually don’t block HTTPS connections as you have to use HTTPS to browse the website.
- You can revoke the Person Access Token (PAT) at anytime with almost no cost.
GitHub Person Access Token Creation Procedures
Long story short, here are the procedures to create a GitHub Person Access Token :
- In the upper-right corner of any page, click your profile photo, then click Settings.
- In the left sidebar, click Developer settings.
- In the left sidebar, click Personal access tokens.
- Click Generate new token.
- Give your token a descriptive name.
- Select the scopes, or permissions, you’d like to grant this token. We want to use token to access repositories, select repo.
- Click Generate token.
- Copy the token to your clipboard. As a reminder,if you navigate off the page (such as closing page), you will not be able to see the token again.
How to Use Personal Access Token in Command Line
You use PAT in command line as follows:
$ git clone https://github.com/username/repo.git Username: your_username Password: *your_token*
You can copy-and-paste the PAT in Password field instead.
How to Save Personal Access Token
Entering the PAT is tedious, so here are two typical approaches for saving PAT:
gitcredentials As this method varies on OS, visit  to get more information.
curlAs I don’t fully get idea about this, visit  to get further information.
Nevertheless, I come up with the following method:
gitcredentialsto save the PAT.
gitcredentialssaves credentials in this file) and you will seethis line:
You can copy-and-paste
<your_token>to password field when GitHub prompts you to enter password.
In this post, I teach you how to create your GitHub Personal Access Token. Moreover, I show a trick how to save your token and copy-and-paste the token as password.