GitHub Auth
Overview
Choose the least surprising GitHub auth path for the current machine, then verify it before doing repository work.
Workflow
- Check what is installed:
git --version
gh --version 2>/dev/null || true
gh auth status 2>/dev/null || true
- Prefer an already-authenticated
ghsession when available. - If
ghis not authenticated, ask the user to completegh auth login. - If
ghis unavailable, use normalgitcredentials or SSH. - Configure commit identity only when needed:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
- Verify with a read-only command before pushing:
git ls-remote origin
Safety
- Never paste tokens into committed files.
- Prefer credential helpers or
gh auth loginover token-in-remote URLs. - Do not print full secrets in summaries, logs, screenshots, or pull requests.