DEV Community

Cover image for Use GIT with SSH on Windows
Raghavendra
Raghavendra

Posted on

Use GIT with SSH on Windows

To connect git remotes using ssh url is sometime tricky in windows machines. Try the following steps to use git with ssh on windows

  • Download and Install latest Putty Executables
  • Run Pageant and add private keys
    • run pageant. It will start minimized on the task bar.
    • Double-click the pageant icon the the task bar.
    • add the private keys, whose public part is uploaded to github/gitlab
    • Need to run the pageant and add keys after every restart

Use puttygen.exe to generate the ssh key-pair
Pageant does not accepts the openssh private key.
puttygen.exe can be used to convert the private key generated from ssh-keygen to PKCS format

  • set environment variable GIT_SSH=C:\Windows\plink.exe
  • To trust the remote host, run plink.exe -agent -v git@github.com one-time for each host

You are all set to clone a repo from github using ssh url. Example - git clone git@github.com:somod-dev/somod.git

Top comments (0)