Failed to connect to repository Error performing git command git ls-remote -https github com jenikis hook git HEAD

Spread The Knowledge

Hello Everyone, we are back with one more DevOps article. Today, in this article we will discuss a scenario where while configuring a GitHub repo in Jenkins, we get the following error – Failed To Connect To Repository Error Performing Git Command Git Ls-Remote -Https Github Com Jenikis Hook Git HEAD.

error screenshot

When I was configuring for the first time, I also had the same error. It took me 2 days to finally figure out the solution for this. But you guys won’t have to wait this long. Let’s just dive into the solution very quickly:

The reason that we are getting this error is, that the machine where Jenkins is running could not able to find the git commands to clone the repository. yes, you got it! You need to install the git in the Jenkins server or your default agent node. Please follow the below steps to install the git on your Jenkins server or agent:


# apt-get install git


# sudo yum install git


# emerge --ask --verbose dev-vcs/git

Arch Linux

# pacman -S git


# zypper install git


# urpmi git


# nix-env -i git


# pkg install git

Solaris 9/10/11

# pkgutil -i git


# pkg_add git


$ apk add git

Windows (PowerShell Method)

winget install --id Git.Git -e --source winget


$ brew install git

After installing git, just restart your Jenkins service and refresh the Jenkins homepage in the browser. Now try to configure/add the repo again, this time you will be able to install it without any issue.


Source: this article

Check out our other popular articles:


Spread The Knowledge

Leave a Comment