Failed to connect to repository : Error performing command: git.exe ls-remote -h https://github.com/szabbas/Sample-programs.git HEAD
Got here much later because of the error mentioned in the question and for new comers, now you should verify your git path at:
Jenkins > Manage Jenkins > Global Tool Configuration > Git
In my case it didn't have the path to git binary in the PATH
environment variable, so I added: C:\Program Files\Git\bin
to it.
In my case this issue happened because of there is no git installed on my CentOS server.
- sudo yum install git
- git --version
After installing git i just make sure that my Global Tool Configuration default pointed to gitJenkins > Manage Jenkins > Global Tool Configuration > Git
- Name : Default
- Path to Git executable : git
just posting this may help you in case of similar issue you had