I’m attempting to write a batch script to clone a bunch of repositories. My problem is that the user has a password protected ssh key. So each time I run call git clone blah@blah/blah.git in my batch file I have to input the users password. I know I can get the password from them as set \p userpwd=[Enter ssh pwd] but how do I pass this to each call?
I’m attempting to write a batch script to clone a bunch of repositories. My
Share
Here is a way to acheive the same effect, but with different steps than what you hinted in your question:
ssh-agentssh-add(it will ask for the password, just once)git clone <url>as you needStep two will ask for a password, instead of using
set /p. The following batch file is somewhat of a port of github’s ssh key guidelines. I tested it with a ssh connection to gitorious, running git version 1.7.6.msysgit.0 under cmd.exe in Windows Vista.