Tokens replace password authentication for Git operations over HTTPS
When using HTTPS Git authentication, GitHub requires a supported authentication mechanism rather than an account password. A personal access token can provide scoped access according to its permissions.
Use the smallest scope possible
Do not create a token with broad permissions when a narrower token can perform the task. Treat tokens like passwords: protect them, never commit them and rotate them if exposure is suspected.
Prefer secure credential storage
Use GitHub CLI authentication or a credential manager rather than writing a token directly into a repository URL or shell history.