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 https://github.com/rammetla/LouisvilleOutletCode git+refs/heads/:refs/remotes/origin/ " returned status code -1: stdout:
Aug 13, 2018 in Git & GitHub by Hannah
• 18,520 points
39,817 views

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,350 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 25, 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(CliGitAPIImpl.java:813)

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:605)

at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:153)

at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler$1.call(RemoteGitImpl.java:146)

at hudson.remoting.UserRequest.perform(UserRequest.java:212)

at hudson.remoting.UserRequest.perform(UserRequest.java:54)

at hudson.remoting.Request$2.run(Request.java:369)

at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)

at java.util.concurrent.FutureTask.run(Unknown Source)

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

at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)

at java.lang.Thread.run(Unknown Source)

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

at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1743)

at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)

at hudson.remoting.Channel.call(Channel.java:957)

at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.execute(RemoteGitImpl.java:146)

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

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.jenkinsci.plugins.gitclient.RemoteGitImpl$CommandInvocationHandler.invoke(RemoteGitImpl.java:132)

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

at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1152)

at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1192)

at hudson.scm.SCM.checkout(SCM.java:504)

at hudson.model.AbstractProject.checkout(AbstractProject.java:1208)

at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)

at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)

at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)

at hudson.model.Run.execute(Run.java:1818)

at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)

at hudson.model.ResourceController.execute(ResourceController.java:97)

at hudson.model.Executor.run(Executor.java:429)

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:

stdout: 

stderr: 

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2042)

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2010)

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2006)

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1638)

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$5.execute(CliGitAPIImpl.java:811)

... 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
• 59,230 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,460 points
7,117 views
–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,340 points

edited Dec 15, 2023 by Khan Sarfaraz 1,170 views
+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,350 points
24,346 views
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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,062 views
+2 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP