title: Using the execute shell command in Jenkins to run git commands on a Windows machine
body: <p>I need to run a bash script that periodically deletes old git branches. I am having trouble finding a way to connect to the git repo via the execute shell option.</p>
  
  <p>Currently I am using cygwin in order to run git commands. Here is what I have in execute shell: </p>
  
  <pre><code>#!c:\cygwin64\bin\bash --login
  git ls-remote git@10.1.1.126:/external-web/collette-com.git 
  </code></pre>
  
  <p>This command is throwing the following error. </p>
  
  <pre><code>[Delete Branches] $ c:\cygwin64\bin\bash --login 
  
  C:\Users\tbraga\AppData\Local\Temp\hudson5750784484659728632.sh
  Host key verification failed.
  fatal: Could not read from remote repository.
  
  Please make sure you have the correct access rights
  and the repository exists.
  Build step 'Execute shell' marked build as failure
  </code></pre>
  
  <p>I have tried running this command in the command line and am prompted for a password. Could this be the issue?</p>
  
  <p>I have the git plugin configured within Jenkins and the connection works perfectly when using Source Code Management Git.</p>
  
  <p>Any suggestions on how to make this connections work in the execute shell field would be greatly appreciated. </p>