We too noticed the same issue with Windows slaves under Jenkins version 2.150.3. Workaround mentioned by Aaron Nelson wasn't working because the next git clone identifies ".git" directory as suspicious. I am able to replicate this issue with "Freestyle" job with below configurations.
- SCM - Git checkout
- Build Environment - Delete workspace before build starts
- Build Trigger - For every 15 mins ( H/15 * * * * (
- Build - This is not important for this testing.
As Bart explained, we are not able to delete the workspace/directory manually as well. Only way is to restart the Jenkins slave process. Workaround: Use "Delete workspace when build is done" in post build section apart of Build Environment. But this doesn't suit some use cases though. Why do Jenkins process use the workspace even after the build completes ? I see especially all these cases are throwing error with .git/objects/pack/<sha file> is in use |