Skip to content

Instantly share code, notes, and snippets.

@ricklambrechts
Last active May 2, 2022 07:48
Show Gist options
  • Save ricklambrechts/78d84f0f4ebd5bb3ec04014deb83fb9b to your computer and use it in GitHub Desktop.
Save ricklambrechts/78d84f0f4ebd5bb3ec04014deb83fb9b to your computer and use it in GitHub Desktop.

Credits: https://interworks.com/blog/2021/09/15/setting-up-ssh-agent-in-windows-for-passwordless-git-authentication/ and https://snowdrift.tech/cli/ssh/git/tutorials/2019/01/31/using-ssh-agent-git-windows.html

Use an elavated PowerShell windows and run the following commands.

To start the ssh-agent automatically

Get-Service ssh-agent | Set-Service -StartupType Automatic -PassThru | Start-Service

Set GIT_SSH environment variable

[Environment]::SetEnvironmentVariable("GIT_SSH", "$((Get-Command ssh).Source)", [System.EnvironmentVariableTarget]::User)

Add ssh keys to agent

ssh-add <path>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment