guide · static export
Software

Set Up Git for Windows With SSH Authentication on a New PC

Install Git, configure your identity, generate an SSH key, and test authentication with a Git host.

by@guidox updated:10/29/26 time:20 min level:Intermediate works on:Windows 11 25H2 x64, Git for Windows, OpenSSH Ed25519 keys tools:Git for Windows, OpenSSH
TL;DR

Install **Git for Windows**, configure your developer identity, and authenticate using an SSH key.

Before you start

Requirements

  • Windows 11 25H2 x64
  • Git for Windows installer from https://git-scm.com/downloads/win
  • Account with a supported Git hosting provider
  • Permission to register SSH public keys
Step by step

Instructions

01

Install Git

Download the official **Git for Windows** installer and complete setup. Keep the default SSH implementation unless your environment needs another.

02

Verify the installation

Open **Git Bash** and check that Git runs successfully.

git --version
03

Configure your identity

Set the name and email address used for future commits.

git config --global user.name 'Your Name'
git config --global user.email 'you@example.com'
04

Generate an SSH key

Create an Ed25519 SSH key with a recognizable comment. Protect it using a passphrase.

ssh-keygen -t ed25519 -C 'you@example.com'
05

Register the public key

Display the public key and copy it into your Git hosting provider's SSH key settings. Never share the private key.

cat ~/.ssh/id_ed25519.pub
⚠ warningThe private key must remain private. Only upload the public key.
06

Test authentication

Run the SSH authentication test for your provider and confirm that your account is recognized.

ssh -T git@github.com
Troubleshooting

Common issues

Permission denied (publickey).

Check that the correct public key is registered, the private key is accessible, and the Git remote uses SSH.

Git is not recognized in Terminal.

Restart Terminal and check the Git for Windows installation and PATH settings.

FAQ

Frequently asked

Can Git use HTTPS instead of SSH?

Yes. Both approaches are supported by many Git hosting providers.

Do I need a separate key for every repository?

Usually not. A registered account key can authenticate to multiple permitted repositories.

How to undo this

Remove the SSH public key from your hosting account, back up or delete the local SSH key pair, remove unwanted global Git configuration, and uninstall **Git for Windows**.

Interactive version: checklist, feedback, related guides →

Free · no account needed · tracks your progress