Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to connect to repository : Error performing command: git.exe ls-remote -h https://github.com/szabbas/Sample-programs.git HEAD

Tags:

git

bash

jenkins

enter image description hereI am new to programming and trying to work with GIT repository and while configuring with the JENKINS is facing the error. I know it's a silly question but on a beginner point of view I am stuck and can't move forward. Please help me in resolving the error.

I have my code at the GIT repository and trying to build using jenkins. But it is giving the error as : Failed to connect to repository : Error performing command: git.exe ls-remote -h https://github.com/szabbas/Sample-programs.git HEAD

I have done to get the cloning through the GID bash and it is cloning with no issues with the URl. I am also attchingenter image description here the image with the same.

like image 671
Syed Avatar asked Mar 08 '16 09:03

Syed


4 Answers

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.

like image 162
Moshisho Avatar answered Oct 19 '22 21:10

Moshisho


I got the answer...just wanted to post here so that if some new programmer are there (like me) can look the basic things :-

While going in the project--> Configure--> set the path of the git correctly.

It should be till the bin and then append git.exe like *\bin\git.exe

like image 27
Syed Avatar answered Oct 19 '22 21:10

Syed


In my case this issue happened because of there is no git installed on my CentOS server.

  1. sudo yum install git
  2. git --version

After installing git i just make sure that my Global Tool Configuration default pointed to git Jenkins > 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

like image 13
munna Avatar answered Oct 19 '22 21:10

munna


Please give the installation path of git.exe in Git executable field in the Global Tool Configuration.In my case it worked after the path was set as below enter image description here

like image 3
visakh.j.b Avatar answered Oct 19 '22 20:10

visakh.j.b