Open PowerShell and run:
ssh-keygen -t ed25519 -C "your_email@example.com"- Press Enter to accept the default location:
C:\Users\YourName\.ssh\id_ed25519 - Add a strong passphrase (recommended) or leave blank
Start-Service ssh-agent
ssh-add $env:USERPROFILE\.ssh\id_ed25519You should see:
Identity added: C:\Users\YourName\.ssh\id_ed25519
Set-Service -Name ssh-agent -StartupType AutomaticGet-Content $env:USERPROFILE\.ssh\id_ed25519.pub | Set-Clipboard- Go to: https://github.com/settings/ssh
- Click "New SSH key"
- In the "Title" field, enter:
Authentication Key - In the "Key type" dropdown, select:
Authentication Key - In the textarea, paste the key using
Ctrl + V - Click "Add SSH key"
- Click "New SSH key" again
- Title:
Signing Key - Key type: select
Signing Keyfrom the dropdown - Paste the same key again using
Ctrl + V - Click "Add SSH key"
Use the SSH URL:
git clone git@github.com:your-username/your-repo.gitUpdate the remote URL:
git remote set-url origin git@github.com:your-username/your-repo.gitGit for Windows uses its own SSH client by default.
Set Git to use the Windows OpenSSH client:
git config --global core.sshCommand "C:/Windows/System32/OpenSSH/ssh.exe"ssh -T git@github.comExpected output:
Hi your-username! You've successfully authenticated...
git config --global gpg.format ssh
git config --global user.signingkey "$env:USERPROFILE\\.ssh\\id_ed25519.pub"
git config --global commit.gpgsign trueYou now have:
- β SSH access to GitHub (no tokens/passwords)
- π Passphrase-free push/pull via ssh-agent
- π§Ύ Verified commits with SSH signing