Janis Lesinskis' Blog

Assorted ramblings

  • All entries
  • About me
  • Projects
  • Economics
  • Misc
  • Software-engineering
  • Sports

Setting the ssh key for a git clone


I was setting up a development environment on Windows today to make an in house script for someone who needed some code to run on windows machines. I ran into the slightly annoying scenario when cloning a Git repository that the default SSH key that was being used was not the one I needed for that host.

To get around this I had to use the following command:

git clone -c core.sshCommand="shh -i ~/ssh/the_key_I_actually_wanted" git@example.com/example-repo.git
Published: Mon 08 August 2022
By Janis Lesinskis
In Software-engineering
Tags: git ssh

links

  • JaggedVerge

social

  • My GitHub page
  • LinkedIn

Proudly powered by Pelican, which takes great advantage of Python.