我有一个git repo,我用于Jenkins的构建。构建失败一致,出现以下错误:
Seen 1 remote branch
Commencing build of Revision 30c6a7a5e6fd30e8519fb3d604a1c195d48ea4fc (origin/master)
Checking out Revision 30c6a7a5e6fd30e8519fb3d604a1c195d48ea4fc (origin/master)
> C:\Program Files (x86)\Git\cmd\git.exe config core.sparsecheckout
> C:\Program Files (x86)\Git\cmd\git.exe checkout -f 30c6a7a5e6fd30e8519fb3d604a1c195d48ea4fc
FATAL: Could not checkout null with start point 30c6a7a5e6fd30e8519fb3d604a1c195d48ea4fc
hudson.plugins.git.GitException: Could not checkout null with start point 30c6a7a5e6fd30e8519fb3d604a1c195d48ea4fc
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$8.execute(CliGitAPIImpl.java:1497)
at org.jenkinsci.plugins.gitclient.AbstractGitAPIImpl.checkout(AbstractGitAPIImpl.java:64)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.checkout(CliGitAPIImpl.java:87)
at hudson.plugins.git.GitAPI.checkout(GitAPI.java:208)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1273)
at hudson.plugins.git.GitSCM.access$1100(GitSCM.java:57)
at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1232)
at hudson.plugins.git.GitSCM$4.invoke(GitSCM.java:1208)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2439)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:328)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1$1.run(Engine.java:63)
at java.lang.Thread.run(Unknown Source)
Caused by: hudson.plugins.git.GitException: Command "C:\Program Files (x86)\Git\cmd\git.exe checkout -f 30c6a7a5e6fd30e8519fb3d604a1c195d48ea4fc" returned status code 1:
stdout:
stderr: error: unable to create file
有一个分支主机,sha-1是最新的结账。此外还出现以下内容:
Note: checking out '30c6a7a5e6fd30e8519fb3d604a1c195d48ea4fc'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at 30c6a7a... Update README.md
我不确定为什么詹金斯认为回购是处于无头状态?
答案 0 :(得分:3)
我遇到了同样的问题,错误的是文件路径太长了,所以我把工作区改成了一个较短的字符串,然后再次工作了。