This note preserves the one-time setup needed when a WSL-local clone must pull from and push to GitHub over SSH.

It is not a general SSH tutorial, not a GitHub account security tutorial, and not required when all commits and pushes happen from the Windows clone.

When This Matters

Use this when the repository is cloned inside WSL, such as:

~/dev/insight-vault

The Windows clone may still exist separately, such as:

C:\dev\insight-vault

When both clones exist, GitHub remains the single source of truth.

Generate An SSH Key

In WSL:

ssh-keygen -t ed25519 -C "you@example.com"

When asked where to save the key, pressing Enter accepts the default path:

/home/<linux-user>/.ssh/id_ed25519

For a personal WSL development environment, leaving the passphrase empty is a convenience choice. Using a passphrase is more protective but adds an unlock step.

Register The Public Key In GitHub

Print the public key:

cat ~/.ssh/id_ed25519.pub

Copy the full output line into:

GitHub -> Settings -> SSH and GPG keys -> New SSH key

A clear title is enough, such as:

WSL Ubuntu 22.04

Verify Authentication

Run:

ssh -T git@github.com

Expected success message:

Hi <github-username>! You've successfully authenticated, but GitHub does not provide shell access.

This confirms authentication. It does not open a shell on GitHub.

Use The SSH Remote

Check the remote:

git remote -v

If the remote uses HTTPS:

https://github.com/<github-username>/<repo-name>.git

Switch it to SSH:

git remote set-url origin git@github.com:<github-username>/<repo-name>.git

Verify:

git remote -v

Expected shape:

origin  git@github.com:<github-username>/<repo-name>.git (fetch)
origin  git@github.com:<github-username>/<repo-name>.git (push)

Set Git Identity In WSL

WSL has its own Git configuration. Set the commit identity once:

git config --global user.name "<github-username>"
git config --global user.email "you@example.com"

Verify:

git config --global --list

Common Mistake: Trailing Dot

Do not type:

ssh -T git@github.com.

The trailing dot makes SSH treat github.com. as a different host name. If this was added to known_hosts by mistake, remove it:

ssh-keygen -R github.com.

Then test the correct host:

ssh -T git@github.com

Working Rule

Use the WSL-local clone when Linux filesystem behavior, permissions, executable bits, debugger behavior, or /mnt/c performance becomes part of the experiment.

Otherwise, it is acceptable to keep using the Windows clone through WSL:

cd /mnt/c/dev/insight-vault