我正在使用 jenkins 构建我的 git 项目,这是我在查看日志时收到的错误。
我在 jenkins 中使用 git 插件。
您将如何解决该错误消息?
Started by user anonymous
Building in workspace E:\sw\jenkins\workspace\se12
ERROR: Workspace has a .git repository, but it appears to be corrupt.
hudson.plugins.git.GitException: Error performing command: git rev-parse --is-inside-work-tree
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1180)
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1150)
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1146)
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:962)
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:972)
hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:651)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
Caused by: java.io.IOException: Cannot run program "C:\Program Files\Git" (in directory "E:\sw\jenkins\workspace\se12"): CreateProcess error=5, Access is denied
at java.lang.ProcessBuilder.start(Unknown Source)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1169)
... 16 more
Caused by: java.io.IOException: CreateProcess error=5, Access is denied
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 22 more
Cloning the remote Git repository
Cloning repository $ git clone \\SE12\Adempiere370new\.git
Fetching upstream changes from $ git clone \\SE12\Adempiere370new\.git
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Error performing command: git fetch --tags --progress $ git clone \\SE12\Adempiere370new\.git +refs/heads/*:refs/remotes/origin/*
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1180)
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1043)
hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:651)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
Caused by: java.io.IOException: Cannot run program "C:\Program Files\Git" (in directory "E:\sw\jenkins\workspace\se12"): CreateProcess error=5, Access is denied
org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1169)
... 14 more
也许您错误地设置了 git 可执行路径。
不应该是这样C:\Program Files\Git
, but C:\Program Files\Git\bin\git.exe
(这类似于JENKINS-6181 https://issues.jenkins-ci.org/browse/JENKINS-6181)
Git 插件页面 https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin确实提到:
如果您看到指示 Git 无法克隆的输出(类似于下面的输出),请转至Jenkins 配置设置(不是项目设置,而是全局设置)并将 Git 路径更改为完全限定路径(例如,不是“git
" but "/usr/bin/git
" 或安装了 Git 二进制文件的任何位置)。
对于您的情况,请检查C:\Program Files\Git
确实是你的Git安装路径。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)