Use Personal Access Token for Github

To pull from a GitHub repository without entering your username and password every time, you can set up authentication using Personal Access Token.

Use Personal Access Tokens (PAT)

GitHub no longer supports password authentication; instead, you can use a PAT.

Steps:

  1. Create a Personal Access Token:
    • Go to Settings > Developer settings > Personal access tokens > Tokens (classic).
    • Generate a new token with the required scopes (e.g., repo).
  2. Store the Token Locally: Save your token securely and use it instead of your password.
  3. Use a Credential Helper to Avoid Entering the Token Repeatedly: git config --global credential.helper store
  4. Clone or Update Remote URL Using HTTPS and Token: git remote set-url origin https://<TOKEN>@github.com/username/repo.git

Replace <TOKEN> with your actual token.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.