0
 Failed to connect to repository : Error performing command: C:\Program
 Files\Git\bin ls-remote -h ssh://git@localhost:7999/sam/bo.git HEAD

Facing above error when trying to integrate GIT with Jenkins. Please see the screen shot of below error.

Jenkins GIT URL Repo Issue

enter image description here

sKhan
  • 9,694
  • 16
  • 55
  • 53
Nash
  • 25
  • 1
  • 3
  • Have you tried connecting over https? Does the connection require any kind of VPN? – dokun1 Mar 21 '16 at 09:33
  • Check This: [Jenkins linking to my local git repository](http://stackoverflow.com/questions/10498554/jenkins-linking-to-my-local-git-repository) – Vic Merlis Mar 21 '16 at 11:36

2 Answers2

1

In you question you have used C:\. Your git path must start with https://

You haven't set the credential for GIT, Create it and set in the credential box of jenkins.

Frits
  • 7,341
  • 10
  • 42
  • 60
Jenish Patel
  • 154
  • 8
0

As you can see the command is not properly started, You have to set the path of git.exe properly so that the command should contain complete path of git.exe(inclusive of git.exe)

Your Command is, C:\Program Files\Git\bin ls-remote -h ssh://git@localhost:7999/sam/bo.git HEAD

You have to set the path of your git.exe(git.exe inclusive) in Manage Jenkins>Global Tool Configuration>Path to Git executable and set path as "C:\Program Files\Git\bin\git.exe"

Once you set the path it would look like C:\Program Files\Git\bin\git.exe ls-remote -h ssh://git@localhost:7999/sam/bo.git HEAD

Once this is done, you can check for https link or ssh link and check for credential as answered above.

ravi creed
  • 371
  • 3
  • 6