I’ve realized it would be helpful to walk through this quickly since I am setting up a new Windows machine for .NET and C++ development. The GitHub guide I’ve always used recommends Git Bash, but this is totally possible with PowerShell.
1. Check your install
OpenSSH.Client should already be installed and running as a service on your Windows machine. But it’s always nice to check, so run a new PowerShell window as an Administrator and ****drop this command in:
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Client*'
We are looking for a state of Installed in the output.
Name : OpenSSH.Client~~~~0.0.1.0
State : Installed
If you see this, yippee! If not, install the Client using this command, restart the Admin terminal, and check again.
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
Note: No need to install
OpenSSH.Server. Just theClientsince this is purely about connecting to GitHub
2. Key generation
Now it’s back to a regular terminal session and ssh commands like you would normally run. Generate your key pair and walk through the steps:
ssh-keygen -t ed25519 -C "your_email@example.com"
3. Start the agent and copy your public key
Now that you have your key pair generated, we will need to copy the public key and, if this is a new Windows box, start the ssh-agent service.
Start up ssh-agent
For an Administrator terminal window, first configure ssh-agent to start automatically:
Get-Service -Name ssh-agent | Set-Service -StartupType Automatic
Then start it up:
Start-Service ssh-agent
Add your private key
ssh-add C:\path\to\your\id_ed25519
Copy your public key
You can do this however you like; the convenient way is to add it to your clipboard with this convoluted PowerShell command:
Get-Content "C:\path\to\your\id_ed25519.pub" | Set-Clipboard
You could also use the type command and manually copy the output. Whatever!
type C:\path\to\your\id_ed25519.pub
4. Add to GitHub and check the connection
And now it’s back to SSH business pt. II! Add your key to GitHub, hurry!
- Go to GitHub.com → your profile → Settings → SSH and GPG keys → New SSH key.
- Give it a descriptive title (e.g.,
Windows Laptop 2026
). - Paste the key (Ctrl+V) into the
Key
field. - Click Add SSH key.
Now you can test your connection and make some commits!
ssh -T git@github.com