@Jenkins部署项目时,git报错fatal: index file smaller than expectedTOC
最近在学习部署Jenkins时,微服务构建一直报错:
Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress https://gitee.com/xxx +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: fatal: index file smaller than expected
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2450)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2051)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:573)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:994)
... 11 more
ERROR: Error fetching remote repo 'origin'
Finished: FAILURE
在网上找到的这个git的问题是这样解决的:
查看链接
由于Jenkins是用服务器上部署的git,并且去拉取远程仓库的,我按照上文的方法去处理,重新push发现仍然不行。
后来发现,将Jenkins中的工作空间要先清理掉,让Jenkins重新从远程仓库拉取,问题解决。如图:
|