CodePudding user response:
This was also reported in Jenkins issue 60204 for git-scm plugin.
Make sure you have the latest version for that plugin.
Try and cleanup the Jenkins workspace associated with the job (with the help of the WS cleanup plugin)
As noted in JENKINS 63581:
The job definition you uploaded as config.xml includes the "clean before checkout" behavior but does not include the "wipe workspace" behavior.
The "clean before checkout" behavior retains the existing git repository (the
.gitdirectory) but removes untracked files.
It does that with thegit clean -xfdcommand.If the workspace had been previously populated with repository content, the "clean before checkout" does not remove that previously created content.
The git plugin tries to reduce data transfer by retaining the git repository across multiple builds in the same workspace.
You would need to add "Wipe workspace" to assure that the two workspaces have the same content.If wipe workspace still shows a difference, then it is likely that there is a difference due to the two versions of command line git being used.

