“Failed to connect to repository” Error while setting up Github Jenkins Plugin

I am getting an error when inputting my repo location into the “Source Code Management > Git > Repository URL” section of a new Job. I have searched all around and tried many different URLs with no success.

Error:

Failed to connect to repository : Error performing command: git ls-remote -h https://github.com/micdoodle8/Crossbow_Mod_2.git HEAD

Any ideas? Thanks.

  • Failure / Unstable via Script Return Code
  • In Jenkins, git fetch is very slow, 11 seconds every time
  • Getting Spring Error “Bean named 'x' must be of type , but was actually of type ” in Jenkins
  • How to link Jenkins to local repository?
  • How can I trigger another job from a jenkins pipeline (jenkinsfile) with GitHub Org Plugin?
  • Jenkins Git Plugin: Failed to connect to repository, returned status code 128
  • Jenkins Master/Slave configuration
  • Jenkins kill all child processes
  • 6 Solutions collect form web for ““Failed to connect to repository” Error while setting up Github Jenkins Plugin”

    You might need to set the path to your git executable in Manage Jenkins -> Configure System -> Git -> Git Installations -> Path to Git executable.

    For example, I was getting the same error in Windows. I had installed git with chocolatey, and got the location via Powershell:

    Get-Command git.exe | Select Definition
    

    In Unix, you should be able to do:

    which git
    

    on Jenkins ver. 2.7.4, the setting property of (Path to Git executable) is now in Manage Jenkins -> Global Tool Configuration -> Git -> Git Installations -> Path to Git executable.

    You should install the Github Plugin for Jenkins.

    After installation, in “Configure” within the project, there should be an input field for “GitHub project”. Input “https://github.com/micdoodle8/Crossbow_Mod_2” (without the quotes) there. Additionally you put the same in the input field which says “Repositories” (the one you mentioned in your question) beneath it.

    I was getting the same thing while connection to git from jenkins. Here is few checklist you would like to watch on :-

    Jenkins Configuration :-
    1) Check whether git executable is appropriately specified
    2) Provide SSH repository link git@blahblah
    3) Under credentials >> Select Username and Authentication key
    (go to your server, Generate SSH keys ssh-keygen… Copy keys to JENKINS_HOME/,ssh)
    You should be able to connect to your GIT repository from Jenkins

    You might need to set the path to your git executable in Manage Jenkins -> global tool configuration -> Git -> Git Installations -> Path to Git executable.

    You have to set your path to your Git executable which is in Global Tool Configuration of Manage Jenkins.
    We can find location of a path via window power-shell as:
    Get-Command git.exe | Select Definition
    shown in pcture as:
    command for git executable path

    Git Baby is a git and github fan, let's start git clone.