Home > Blockchain >  Set user and PAT so I don't ever have to enter it again?
Set user and PAT so I don't ever have to enter it again?

Time:02-17

How do I set the user and PAT (Personal Access Token) on a cloned github so that I never have to type them in again?

CodePudding user response:

Try this:

Using Personal Access Tokens with Git and GitHub

  1. Get Token

    The first step in using tokens is to generate a token from the GitHub website

  2. Configure local GIT

    Once we have a token, we need to configure the local GIT client with a username and email address. On a Linux machine, use the following commands to configure this, replacing the values in the brackets with your username and email.

    git config --global user.name ""
    git config --global user.email ""
    git config -l
    
  3. Clone from GitHub

    Once GIT is configured, we can begin using it to access GitHub. In this example I perform a git clone command to copy a repository to the local computer. When prompted for the username and password, enter your GitHub username and the previously generated token as the password.

  4. Configure Credential Caching

    Lastly, to ensure the local computer remembers the token, we can enable caching of the credentials. This configures the computer to remember the complex token so that we don't have to.

    git config --global credential.helper cache
    

    If needed, you can later clear the token from the local computer by running

    git config --global --unset credential.helper
    
  • Related