Set up an SSH key for GitHub
Push and pull without typing a password. Generate a key, add it to GitHub, and test it.
Generate a key
Press Enter to accept the default file, then choose a passphrase.
ssh-keygen -t ed25519 -C ""Copy the public key
On Windows use the PowerShell version from the SSH commands.
pbcopy < ~/.ssh/id_ed25519.pubAdd it to GitHub
GitHub → Settings → SSH and GPG keys → New SSH key. Paste and save.
Test the connection
Type yes if asked to trust GitHub’s fingerprint.
ssh -T git@github.comHi you! You've successfully authenticated, but GitHub does not provide shell access.
Switch an existing repo to SSH
Point the remote at the SSH address.
git remote set-url origin