jenkinsci / jenkinsci/git-plugin

[JENKINS-13685] Git clean on Multi Configuration build requires re-clone of slave repo

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

Description

I've just set up a Multi Configuration job: a master with no build responsibilities & 3 slaves (mac, win, linux). I see that the master clones a copy of the source repo into the root of one of the slave's workspace: workspace/projectname/contentsofrepo.

Then, the slave clones a separate copy of the same repo for its own purposes: workspace/projectname/label/osx/contentsofrepo.

I prefer to use the "Clean after checkout" option for my git projects, to ensure a clean workspace on a fresh build. However, with this enabled the master's git repo sees the slave's repo (again, located within the master's copy) as a directory not tracked by git and removes it, meaning that when the slave runs, it has to re-clone the entire repo, which takes about a half hour for our project.

I would expect the master & slave's copies of the repos to not overlap with one another such that they could be cleaned independently of one another.

---
Originally reported by liamstask, imported from: Git clean on Multi Configuration build requires re-clone of slave repo


  • status: Open
  • priority: Major
  • component(s): git-plugin
  • label(s): git, gitplugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 2
  • imported: 2025-12-02

Raw content of original issue

I've just set up a Multi Configuration job: a master with no build responsibilities & 3 slaves (mac, win, linux). I see that the master clones a copy of the source repo into the root of one of the slave's workspace: workspace/projectname/contentsofrepo.

Then, the slave clones a separate copy of the same repo for its own purposes: workspace/projectname/label/osx/contentsofrepo.

I prefer to use the "Clean after checkout" option for my git projects, to ensure a clean workspace on a fresh build. However, with this enabled the master's git repo sees the slave's repo (again, located within the master's copy) as a directory not tracked by git and removes it, meaning that when the slave runs, it has to re-clone the entire repo, which takes about a half hour for our project.

I would expect the master & slave's copies of the repos to not overlap with one another such that they could be cleaned independently of one another.

  • environment: OS X, Windows7, Linux. Jenkins 1.462

1 attachment

- [JENKINS-13685-example.PNG](https://raw.githubusercontent.com/jenkinsci/attachments-from-jira-issues-last/refs/heads/main/attachments/25593/JENKINS-13685-example.PNG)
> ![JENKINS-13685-example.PNG](https://raw.githubusercontent.com/jenkinsci/attachments-from-jira-issues-last/refs/heads/main/attachments/25593/JENKINS-13685-example.PNG)

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.