jenkinsci / jenkinsci/git-plugin

[JENKINS-44729] Optimize git clones via shared reference repo for multi branch builds of same repository

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

Description

We love the new pipeline multi branch (and github org) plugin models, but have a general issue of bloated disk usage and slow clones for some of our more active and larger repositories. Specifically we have an active repo that has a lot of open PRs at any given time and a few long-running mainline/maintenance branches.

Every time a new branch or PR is opened, we generate a new clone on at least one build node for the new build (and typically as the PR gets more commits and the build nodes get assigned for subsequent builds differently it multiples to more clones on other machines).

Given that these branches and PRs are all for the same repository, it'd be great to automatically have it silently share a common reference repo on each build node. Something like automatically incorporating https://github.com/orrc/git-webhook-proxy into the workflow.

Otherwise with a single repo having ~70 open PRs at any given time and 4 main branches, we end up with ~74 clones of the *same* repo on each build node. That's a significant unnecessary disk bloat and network bandwidth hog. As a first level, just having a full clone to use as a reference per-repo per-agent would be a big help.

---
Originally reported by seadub, imported from: Optimize git clones via shared reference repo for multi branch builds of same repository


  • status: Open
  • priority: Major
  • component(s): git-plugin
  • label(s): multibranch, pipeline
  • resolution: Unresolved
  • votes: 9
  • watchers: 14
  • imported: 2025-12-02

Raw content of original issue

We love the new pipeline multi branch (and github org) plugin models, but have a general issue of bloated disk usage and slow clones for some of our more active and larger repositories. Specifically we have an active repo that has a lot of open PRs at any given time and a few long-running mainline/maintenance branches.

Every time a new branch or PR is opened, we generate a new clone on at least one build node for the new build (and typically as the PR gets more commits and the build nodes get assigned for subsequent builds differently it multiples to more clones on other machines).

Given that these branches and PRs are all for the same repository, it'd be great to automatically have it silently share a common reference repo on each build node. Something like automatically incorporating https://github.com/orrc/git-webhook-proxy into the workflow.

Otherwise with a single repo having ~70 open PRs at any given time and 4 main branches, we end up with ~74 clones of the *same* repo on each build node. That's a significant unnecessary disk bloat and network bandwidth hog. As a first level, just having a full clone to use as a reference per-repo per-agent would be a big help.

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.