I wanted to write a script that ran in Windows command prompt and utilised Git Ssh.
This is simple to do with git-bash or here and I found quite a few instructions on Stackoverflow with solutions. Unfortunately, the problem with these approaches wass that if you are trying to write a windows command/powershell script rather that a bash script in Windows, this problem will need to be solved for Windows command prompt rather than for Git Bash.
- Download and install Git for Windows
- setx SSHAUTHSOCK H:.ssh.ssh-pageant-username
- "C:\Program Files\Git\cmd\start-ssh-agent.cmd"
- git clone ssh://[email protected]:22/VSTSProject/_ssh/Repository
I found this useful link with further information.
Other approaches include using Tortoise git or Putty to resolve the problem. However, I preferred resolving it without necessarily installing additional client side tools (apart from Git for Windows of course).