Jenkins not able to fetch code from remote git
I was seeing the same issue, but disk space and VM memory were not the problem. What fixed it for me was making the job re-clone on build:
- Go to the job's "Configure" page
- Under Source Code Management → Git → Additional Behaviors, add a behavior "Wipe out repository & force clone"
- Save
- Build