DEV Community

Cover image for Use GIT with SSH on Windows
Raghavendra
Raghavendra

Posted on

1

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

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free