-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
Jenkins ver. 2.60.2
Git help says:
-f, --force
If the Git configuration variable clean.requireForce is not set to false, git clean will refuse to delete files or
directories unless given -f, -n or -i. Git will refuse to delete directories with .git sub directory or file unless a second
-f is given.
There is no point in keeping alive directories with .git sub directories, since when dealing with submodules there might be branches that add a new submodule that is not present in another one, and when building accross them, submodule garbage will be left out.
- duplicates
-
JENKINS-26660 Add another '-f' to git clean to remove deleted submodules or other repos checked out in workspace in pipeline
-
- Closed
-
- is related to
-
JENKINS-7376 git - clean before build does not clean submodules
-
- Closed
-
-
JENKINS-63383 Polluted workspace -- "Clean after checkout" (git clean -fdx) won't remove git repositories in subdirectories
-
- Closed
-
Closing this as a duplicate of
JENKINS-29893and JENKINS-39111. The comments in those bug reports provide a good summary of the many different use cases which would be broken if the extra "force" option were added unconditionally.Pull requests have been submitted proposing to optionally allow clean with the extra force option, and to allow clean with the extra force option and exclusion lists.
I'd love to have help from others evaluating if those pull requests meet your needs as well.