我的Jenkins工作由于一些Git错误而失败,这种情况经常发生但不是每次都发生 怎么解决这个?
22:17:00 ERROR: Error fetching remote repo 'origin'
22:17:00 hudson.plugins.git.GitException: Failed to fetch from ssh://git@bcds01.de.bosch.com:7999/bse/bse_application.git
22:17:00 at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:810)
22:17:00 at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1066)
22:17:00 at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1097)
22:17:00 at org.jenkinsci.plugins.multiplescms.MultiSCM.checkout(MultiSCM.java:143)
22:17:00 at hudson.scm.SCM.checkout(SCM.java:485)
22:17:00 at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
22:17:00 at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
22:17:00 at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
22:17:00 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
22:17:00 at hudson.model.Run.execute(Run.java:1738)
22:17:00 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
22:17:00 at hudson.model.ResourceController.execute(ResourceController.java:98)
22:17:00 at hudson.model.Executor.run(Executor.java:410)
22:17:00 Caused by: hudson.plugins.git.GitException: Command "C:\Program Files\Git\cmd\git.exe reset --hard" returned status code 128:
22:17:00 stdout:
22:17:00 stderr: error: unable to unlink old 'Sensor/test/system/tools/leshan-server-demo/leshan-server-demo.jar' (Invalid argument)
22:17:00 fatal: Could not reset index file to revision 'HEAD'.
答案 0 :(得分:0)
为避免出现此错误,请确保您的提交父级是您推送的分支的HEAD,即在推送之前重新生成。