error cloning remote repo origin

+2 votes

 I am trying build a job which pull the code from the githib repo. This works most of the time but sometimes all of sudden i get the below error in Jenkins.

ERROR: Error cloning remote repo 'origin' hudson.plugins.git.GitException: Command "C:\Program Files\Git\cmd\git.exe fetch --no-tags --progress" returned status code -1: stdout:
Aug 13, 2018 in Git & GitHub by Hannah
• 18,550 points

5 answers to this question.

0 votes

Try doing this, it’ll help you get rid of any HTTP S credential issues

  • Use SSH URL instead
  • Use the Jenkins SSH credentials plugin-> This plugin allows you to store SSH credentials in Jenkins.
answered Aug 13, 2018 by Kalgi
• 52,290 points
0 votes
Probably git is not configured properly in Jenkins. Check that out once.
answered Apr 24, 2019 by Vishal
0 votes

Follow these steps:

  • Go to Manage Jenkins
  • Go to Global Tool Configuration
  • In Git / Path to Git executable enter C:\<whatever the path is>\git.exe.
  • Click on Save.
answered Apr 24, 2019 by Bina
This Solution worked for me.
+1 vote
ERROR: Error cloning remote repo 'origin'

hudson.plugins.git.GitException: Could not init F:\jenkins_remotedirectory\workspace\windowsCompile

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(

at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$

at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$

at hudson.remoting.UserRequest.perform(

at hudson.remoting.UserRequest.perform(

at hudson.remoting.Request$

at hudson.remoting.InterceptingExecutorService$

at Source)

at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.util.concurrent.ThreadPoolExecutor$ Source)

at hudson.remoting.Engine$1.lambda$newThread$0(

at Source)

Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from

at hudson.remoting.Channel.attachCallSiteStackTrace(

at hudson.remoting.UserRequest$ExceptionResponse.retrieve(


at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(

at sun.reflect.DelegatingMethodAccessorImpl.invoke(

at java.lang.reflect.Method.invoke(

at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(

at com.sun.proxy.$Proxy80.execute(Unknown Source)

at hudson.plugins.git.GitSCM.retrieveChanges(

at hudson.plugins.git.GitSCM.checkout(

at hudson.scm.SCM.checkout(

at hudson.model.AbstractProject.checkout(

at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(

at jenkins.scm.SCMCheckoutStrategy.checkout(

at hudson.model.AbstractBuild$

at hudson.model.Run.execute(


at hudson.model.ResourceController.execute(


Caused by: hudson.plugins.git.GitException: Command "C:\Users\Siraj_Muneera\Downloads\softwares\Git-2.21.0-64-bit.exe init F:\jenkins_remotedirectory\workspace\windowsCompile" returned status code -1:



at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(

... 12 more

ERROR: Error cloning remote repo 'origin'
Finished: FAILURE

This was the error when i tried to build a jenkins job on the windows slave agent. I resolved it by correctly configuring the Git.exe location on my windows slave agent.

Go to Manage jenkins -> Manage nodes -> click on the windows_slave agent -> Configure

Under Node properties -> tool locations-> Specify the correct path of your Git.exe (In case you don't know the location of git on your machine,run "where git" command) -> save.

answered Jun 3, 2019 by Sirajul
• 58,990 points
Thank you for this information helped me alot!
0 votes

Check the git repo, it might configured incorrectly in jenkin

answered Jul 10, 2020 by anonymous

Related Questions In Git & GitHub

0 votes
1 answer

How to remove remote origin from Git repo?

Hi@akhtar, You can remove or add a new ...READ MORE

answered Sep 4, 2020 in Git & GitHub by MD
• 95,060 points
–1 vote
1 answer

Having problem in Github and remote Git repo with production and development code

I think you could start with this. The ...READ MORE

answered Apr 10, 2018 in Git & GitHub by shubham
• 7,320 points
+2 votes
3 answers

Cloning the Git Repository on Eclipse (Transport Error)

File/Import... Select dialog * Git/Projects from Git * click next Select ...READ MORE

answered Jul 23, 2018 in Git & GitHub by Kalgi
• 52,290 points
0 votes
0 answers
0 votes
1 answer
0 votes
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
+2 votes
1 answer