4. personal access token - JohnyzHub/GIT GitHub Wiki

Login to your GitHub Account and navigate to Settings > Developer Settings > Personal Access Tokens > Tokens (classic)

Fill in your desired access level / settings for your Personal access token. I selected all the permissions, for simplicity.

When you are done selecting your settings click “Generate token”. when you click “Generate new token (classic)” GitHub is going to give you a token that you will need to copy to a blank text file and keep somewhere safe. This access key can be used multiple times.

however GitHub is only going to display it ONCE to you, which means when you close out of your browser or navigate away from the page, you won’t have a means to recover it and you will need to repeat the process to create another access key again.

Now in your Command Line, git clone the repository. You will be prompted for your username and password. In the password line paste in your Personal Access Token that you just created. if everything worked as expected, the git repo should be cloned successfully.

tip: to avoid input the login credentials every time, you can save them locally by following below procedure:

 git config --global credential.helper store

Note that you will be prompted to introduce your credentials again the next time you use git before the credential manager saves them.

ref: github-personal-access-token