error cloning remote repo 'origin'

0 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
• 14,070 points
3,052 views

4 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
• 40,420 points
0 votes
Probably git is not configured properly in Jenkins. Check that out once.
answered Apr 24 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 by Bina
0 votes
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 by Sirajul
• 25,180 points

Related Questions In Git & GitHub

0 votes
1 answer
0 votes
0 answers
0 votes
1 answer

Git origin not found

For this to work, you need to ...READ MORE

answered Apr 25, 2018 in Git & GitHub by DragonLord999
• 8,380 points
145 views
0 votes
1 answer

error saying unmerged paths

Git merging means taking changes from one ...READ MORE

answered Jun 27, 2018 in Git & GitHub by anonymous
181 views
+13 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,380 points
145 views
0 votes
1 answer
+1 vote
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
• 40,420 points
2,279 views
0 votes
2 answers

difference between git remote and git clone

git remote add just creates an entry in ...READ MORE

answered Aug 7, 2018 in Git & GitHub by Kalgi
• 40,420 points
622 views