jenkinsci / jenkinsci/git-plugin

[JENKINS-48631] Automatically remove the cache created on disk when lightweight checkout is used

Open
#3,248 4 comments 0 reactions 0 assignees View on GitHub
component:git-plugin component:scm-api-plugin enhancement imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

The %JENKINS_HOME%\caches\git- directories are created by Pipeline jobs -I believe that ONLY when doing a lightweight checkout.

The sha in the name of the directory %JENKINS_HOME%\caches\git- represent a key for a specific remote that is calculated from the remote URL: "git-" + hudson.Util.getDigestOf(). Each directory corresponds to a specific repository. If many jobs are cloning the same repository, they all point to the same "cache" directory.

The problem comes when the repository are very large, which can produce to fill the disk space as there not seem to be any automatic mechanism for deleting these files.

---
Originally reported by fbelzunc, imported from: Automatically remove the cache created on disk when lightweight checkout is used


  • status: Open
  • priority: Minor
  • component(s): git-plugin, scm-api-plugin
  • resolution: Unresolved
  • votes: 3
  • watchers: 9
  • imported: 2025-12-02

Raw content of original issue

The %JENKINS_HOME%\caches\git-<sha> directories are created by Pipeline jobs -I believe that ONLY when doing a lightweight checkout.

The sha in the name of the directory %JENKINS_HOME%\caches\git-<sha> represent a key for a specific remote that is calculated from the remote URL: "git-" + hudson.Util.getDigestOf(<remote>). Each directory corresponds to a specific repository. If many jobs are cloning the same repository, they all point to the same "cache" directory.

The problem comes when the repository are very large, which can produce to fill the disk space as there not seem to be any automatic mechanism for deleting these files.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.