- Ensuring that Jenkins was running as the correct user.
- Ensuring that the user's
.sshdirectory and keys were in place and checked out.
- Trying the full path to
git.exein Git's bin directory rather than just using
gitas the path.
I did a search for the error, but as in the past it turned up no solutions that actually fixed the problem for me. I then tried running a job that just executed a Windows batch command to run
git clone on the same repository... which worked fine!
Double-checking things, I noticed that my PATH contained two directories for my Git installation (msysgit): one for
Git/bin and another for
Git/cmd, which I hadn't been aware of before. Looking in
Git/cmd, I noticed that it contained a file
git.cmd which appeared to be some kind of script wrapping
git.exe. So, I went into the Jenkins configuration and changed the path to the git executable to
git.cmd. And that fixed everything!
Based on what I've seen when searching for this error, it seems like there are quite a few potential causes for it. But this is what worked for me in my situation and I haven't seen this solution elsewhere, so I thought I'd write it down... if nothing else to help me remember if it happens again.