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:
- 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
).
- Store the Token Locally: Save your token securely and use it instead of your password.
- Use a Credential Helper to Avoid Entering the Token Repeatedly:
git config --global credential.helper store
- 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.