Updating GitHub Authentication Using Token on macOS
With GitHub’s recent changes, passwords are no longer allowed for authentication when performing actions like git push or git pull.
Step 1: Generate a Personal Access Token
- Go to GitHub → Settings → Developer settings → Personal access tokens
- Click Generate new token
- Select scopes: at minimum check
repo - Click Generate token and copy it immediately (you won’t see it again)
Step 2: Clear Old Credentials on macOS
git credential-osxkeychain erase
host=github.com
protocol=https
# Press Enter twice
Or via Keychain Access app: search for github.com and delete the entry.
Step 3: Use Token on Next Push
git push origin main
# Username: your GitHub username
# Password: paste your personal access token here
macOS will offer to save it to Keychain — say yes to avoid entering it again.
That’s it! Your GitHub authentication is now updated to use a personal access token.