Windows: Use PuTTY for git SSH (Or any SSH agent)

Something that seems to come up a lot when using git on windows is wanting to use an SSH client to manage keys. When you want to use something like PuTTY its a fairly simple, but somewhat hidden process.

By default, git will look in your C:\Users\<username>\.ssh for an id_rsa key and load that.

To get git to load keys from an SSH client instead, you need to add an environment variable (GIT_SSH) pointing to the directory of the client you are using:

The next time you open a command line tool (cmd/powershell/mingw) git will use the SSH agent instead of loading the id_rsa key.

--

--

Holistic software engineer. https://jjt.dev

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store