I\'ve installed Jenkins on my mac (osx lion). But I couldn\'t get it work. This is the stacktrace I\'ve got:
Started by user anonymous
Checkout:workspace /
Environment:Linux Error: "jenkins Failed to connect to repository : Error performing command: git ls-remote -h"
Solution : if repository URL and credential configured correctly ,problem on git installion and config a) make sure git installed on your linux machine. if git not installed , install it ("sudo yum install git") b) Goto to -> Manage Jenkins -> Global Tool Configuration ->Git->Path to Git executable make sure "git" command present.
I had a similar problem finding the git executable on OS X.
I had to change my Path to Git executable to : /usr/local/git/bin/git
Might give that a shot if you are still stuck.
The solution for me was to set the git path in the Manage Jenkins > Global Tool Configuration settings. In the Git section, I changed the Path to Git executable to /usr/local/bin/git
.
Like Darksaint2014 said, you need to configure two parts if you installed Jenkins in Windows.
If you installed your Jenkins in windows, you need to install Git in both local and your linux server, then configure below in both locations:
Global tool configuration:
For server side:
Please install git in your Jenkins server. For example, if you are using Red Hat Enterprise Linux where you are hosting Jenkins, then install git in that server using the following command: sudo yum install git This should solve the problem as git executable will be available in /usr/bin/git then and this will be recognized automatically by jenkins and this you can verify by navigating to Manage Jenkins --> Global Tool Configuration. Then under Git installations, there will not be any warning and now you should be able to clone your git project in jenkins. Hope this help the users.
For Jenkins 2.121.3 version, Go to Manage jenkins -> Global tool configuration -> Git installations -> Path to Git executable: C:\Program Files\Git\bin\git.exe It works!
In Jenkins, give the http URL. SSH URL shows similar error.