jenkinsci / jenkinsci/git-plugin

[JENKINS-27211] Please add ability to use the git 'clean' options AFTER job execution

Open
#2,613 5 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

I would love to be able to have my jobs automatically return the workspace to a clean state after execution - but otherwise leave the cloned repo present at the end of a job automatically. I could do this myself in a post step, but seems like it would be nice to be able to just define this in the SCM section and have it done automatically.

Even better would be ability to say "Clean after job, if:


{stable|unstable|failed}

" - to allow leaving the workspace around for examination if the job fails, but otherwise clean when done.

---
Originally reported by nneul, imported from: Please add ability to use the git 'clean' options AFTER job execution


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

Raw content of original issue

I would love to be able to have my jobs automatically return the workspace to a clean state after execution - but otherwise leave the cloned repo present at the end of a job automatically. I could do this myself in a post step, but seems like it would be nice to be able to just define this in the SCM section and have it done automatically.

Even better would be ability to say "Clean after job, if:


{stable|unstable|failed}

" - to allow leaving the workspace around for examination if the job fails, but otherwise clean when done.

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.