jenkinsci / jenkinsci/git-plugin

[JENKINS-40343] Allow passing custom clean parameters(for example -e "node_modules")

Open
#3,007 2 comments 0 reactions 0 assignees View on GitHub
component:git-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

Hi,

We want to use cleanBeforeCheckout() options but we want to exclude node_modules from cleaning. [Git clean](https://git-scm.com/docs/git-clean) has -e option which we want to use in this case.

So do you think it would be a good idea to pass extra arguments to cleanBeforeCheckout:

cleanBeforeCheckout("-e node_modules")

---
Originally reported by ivanovit, imported from: Allow passing custom clean parameters(for example -e "node_modules")


  • status: Open
  • priority: Minor
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 4
  • imported: 2025-12-02

Raw content of original issue

Hi,

We want to use cleanBeforeCheckout() options but we want to exclude node_modules from cleaning. [Git clean](https://git-scm.com/docs/git-clean) has -e option which we want to use in this case.

So do you think it would be a good idea to pass extra arguments to cleanBeforeCheckout:
cleanBeforeCheckout("-e node_modules")

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.