Using the execute shell command in Jenkins to run git commands on a Windows machine Using the execute shell command in Jenkins to run git commands on a Windows machine jenkins jenkins

Using the execute shell command in Jenkins to run git commands on a Windows machine


I solved this problem by passing my credentials to my execute shell script through the Credentials Binding Plugin in Jenkins


It's simple enough to create an SSH key associated with your user.

Try here : https://confluence.atlassian.com/bitbucketserver/creating-ssh-keys-776639788.html

Put keys under %userprofile%/.ssh and try running it again.

You can also use the same credentials used in your Jenkins configuration


I use SSH keys for auth to Github and had this same issue. My Jenkins configuration has EC2 slaves, so the default SSH key on the machine wasn't correct for Github.

I fixed it with the SSH Agent Plugin. In the job, enable the "SSH Agent" setting and choose the stored SSH key for Github authentication. It should be the same one selected for the Git-SCM configuration used to clone the repo.