Interview Prep/Git & GitHub/Conflicts, remotes, fetch, pull and push

How should you authenticate over HTTPS on a developer machine and in CI?

IntermediateConceptConflicts, remotes, fetch, pull and push
Answer

Passwords are no longer accepted by GitHub. Developers use Git Credential Manager or gh auth login, which stores an OAuth token in the OS keychain. In CI use the short-lived GITHUB_TOKEN, a GitHub App installation token, or a fine-grained PAT, never a personal classic PAT.

gh auth login
gh auth setup-git
All Git & GitHub questions Roadmap: Git & GitHub

More on Conflicts, remotes, fetch, pull and push