Listen to Episode 21: Git Authentication - a conversational audio overview of this chapter. Listen before reading to preview the concepts, or after to reinforce what you learned.
Audience: This appendix is for contributors who need to configure Git authentication for push access. If you're working entirely through the GitHub web interface or GitHub Desktop, you can skip this. If you're using VS Code with Git command line, this becomes relevant when you want to push commits to your fork.
GitHub requires authentication when you:
- Push commits to a repository
- Clone a private repository
- Access organization repositories with specific permissions
You do not need authentication to:
- Clone public repositories
- View public repositories on GitHub.com
- Read issues and pull requests
A Personal Access Token is a password-like string you generate on GitHub and use instead of your account password when Git asks for credentials.
- Works on all operating systems
- Easy to set up for screen reader users (no command line required)
- Can be scoped to specific permissions
- Easy to revoke if compromised
- You have to store it securely
- Expires after a set time (you must regenerate)
SSH uses public-key cryptography. You generate a key pair on your computer (public + private), upload the public key to GitHub, and Git uses the private key to prove your identity.
- Once set up, works automatically (no password prompts)
- More secure than tokens
- Never expires
- Requires command-line setup (less accessible for some screen reader users)
- Slightly more complex initial configuration
Why this method: It's screen reader accessible through the GitHub web interface, and you can complete it without command-line Git configuration.
- Navigate to github.com/settings/tokens
- Select "Tokens (classic)" from the left sidebar
- Activate "Generate new token" → Select "Generate new token (classic)"
- Give it a descriptive name in the Note field: "Workshop Laptop Token"
- Set expiration: 30 days or 60 days (recommended for temporary workshop use)
- Select scopes:
repo- Full control of private repositories (includes public repo access)workflow- Update GitHub Actions workflows (if you'll work with Actions)
- Scroll down and activate "Generate token"
- CRITICAL: Copy the token immediately - you cannot see it again
Screen reader note: The token appears as a long string in a text field. Select all (Ctrl+A), copy (Ctrl+C), and paste it into a secure note or password manager.
- Password manager (1Password, Bitwarden, LastPass) - best option
- Encrypted note in your operating system's secure notes
- Plain text file in an encrypted folder (temporary only)
- Paste it into a document you sync to cloud storage unencrypted
- Email it to yourself
- Save it in a public GitHub file
The next time Git asks for your password (when you push, pull from a private repo, or clone a private repo):
Username: [your-github-username]
Password: [paste-your-PAT-here]
Windows Git Credential Manager: Windows will remember this token automatically after your first use. You only paste it once.
macOS Keychain: macOS will offer to save it to Keychain. Select "Always Allow."
Linux: You can configure Git to cache credentials:
git config --global credential.helper cacheIf you prefer SSH and are comfortable with terminal commands:
ls -al ~/.sshLook for files named id_rsa.pub, id_ed25519.pub, or similar. If you see these, you already have a key.
ssh-keygen -t ed25519 -C "your-email@example.com"When prompted:
- Press
Enterto accept the default file location - Enter a passphrase (optional but recommended)
Screen reader note: Git will print output showing where the key was saved. It generates two files: id_ed25519 (private) and id_ed25519.pub (public).
Get-Content ~/.ssh/id_ed25519.pub | Set-Clipboardpbcopy < ~/.ssh/id_ed25519.pubcat ~/.ssh/id_ed25519.pub
# Manually select and copy the output- Navigate to github.com/settings/keys
- Select "New SSH key"
- Title: "Workshop Laptop SSH Key"
- Key type: Authentication Key
- Key: Paste your public key (should start with
ssh-ed25519orssh-rsa) - Select "Add SSH key"
- Confirm with your password or 2FA code
ssh -T git@github.comYou should see: Hi username! You've successfully authenticated...
When cloning or adding remotes, use SSH URLs instead of HTTPS:
# SSH format
git@github.com:owner/repo.git
# Instead of HTTPS
https://github.com/owner/repo.git
If you cloned with HTTPS but want to use SSH (or vice versa), update the remote:
git remote -vgit remote set-url origin git@github.com:your-username/repo.gitgit remote set-url origin https://github.com/your-username/repo.gitProblem: Your token expired or is incorrect.
- Generate a new PAT
- Clear your credential cache (Windows: Credential Manager; macOS: Keychain; Linux:
git credential-cache exit) - Try pushing again - Git will ask for credentials
Problem: SSH key not properly set up.
- Verify your key is added to GitHub: github.com/settings/keys
- Check SSH agent is running:
ssh-add -l - Add your key to the agent:
ssh-add ~/.ssh/id_ed25519
Problem: SSH doesn't recognize GitHub's host key.
ssh-keyscan github.com >> ~/.ssh/known_hosts- Never share your private key or PAT - treat them like passwords
- Use scoped PATs - only grant the minimum permissions needed
- Set expiration dates on PATs - regenerate periodically
- Use a passphrase on SSH keys - adds another layer of security
- Revoke old tokens when you're done with a project or device
- Don't commit tokens or keys to Git - use
.gitignorefor config files
When you push commits to GitHub, each commit shows a small badge: Verified or Unverified. This badge tells anyone viewing the commit history whether the commit was cryptographically signed - proving it came from you and was not tampered with.
Open source maintainers increasingly require signed commits before merging. Some repositories enforce this with branch protection rules. If you contribute to accessibility-agents and your commits show "Unverified," a maintainer may ask you to sign them before the PR can be merged.
If you already have an SSH key set up for authentication, you can use it for signing too.
git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/id_ed25519.pub
git config --global commit.gpgsign true- Navigate to github.com/settings/ssh
- Select "New SSH key"
- Change "Key type" to "Signing Key" (not Authentication Key)
- Paste your public key and save
Your commits now show the Verified badge in GitHub's commit history.
gpg --full-generate-key
# Choose: RSA and RSA, 4096 bits, never expires
# Enter your GitHub email address when promptedgpg --list-secret-keys --keyid-format=long
# Output includes: sec rsa4096/XXXXXXXXXXXXXXXX
# The X's are your key IDgpg --armor --export YOUR_KEY_ID
# Copies the block starting with -----BEGIN PGP PUBLIC KEY BLOCK------ Navigate to github.com/settings/gpg-keys
- Select "New GPG key" → paste the exported public key
git config --global user.signingkey YOUR_KEY_ID
git config --global commit.gpgsign trueGitHub has an optional setting called Vigilant Mode (in Settings → SSH and GPG Keys → Vigilant mode). When enabled, GitHub marks all commits from your account as "Unverified" unless they are signed - even commits that were previously shown without a badge.
- It makes tampered or spoofed commits immediately obvious
- It signals that the repository cares about commit provenance
- Every unsigned commit you push will show a yellow "Unverified" badge
- This is a visual signal - commits can still be pushed, but maintainers may block the merge
- Navigate to the repository's commit history (Code tab → Commits link)
- Each commit row contains either "Verified" or "Unverified" as a badge element
- NVDA/JAWS: the badge is inside the commit row; use
↓to read through each row and the badge text is read inline - VoiceOver: use
VO+Rightthrough the commit row; the badge is read as a button with the text "Verified" (clicking it shows the certificate)
Workshop recommendation: SSH signing is simpler to set up than GPG and reuses your existing key. If you have 10 minutes, configure it before Day 2 - every commit you push to accessibility-agents will show as Verified.
- Generate a Personal Access Token with 30-day expiration
- Scope:
repoandworkflow - Store it in your password manager
- Use it when VS Code or Git asks for a password
SSH keys are great for long-term use, but PATs are faster to set up and more accessible for screen reader users during a time-constrained workshop.
Return to: Pre-Workshop Setup | Resources