When Jenkins deploys the project, GIT reports an error fatal: index file smaller than expected

@When Jenkins deploys the project, GIT reports an error fatal: index file smaller than expectedtoc

Recently, when learning to deploy Jenkins, microservice construction has been reporting errors:

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

The GIT problem found on the Internet is solved as follows:

View links

Because Jenkins uses git deployed on the server to pull the remote warehouse, I handle it according to the above method and re push it. It still doesn’t work.

Later, it was found that the workspace in Jenkins should be cleaned up first, and Jenkins should be pulled from the remote warehouse again. The problem was solved. As shown in the figure:

Read More: