From: Junio C Hamano Date: Sun, 02 Dec 2018 19:37:03 GMT Subject: Re: [RFC] git clean --local Message-ID: In-Reply-To: <004101d48a65$afb0da40$0f128ec0$@nexbridge.com> "Randall S. Becker" writes: > Would something like git clean --exclude=file-pattern work as a > compromise notion? Files matching the pattern would not be cleaned > regardless of .gitignore or their potential preciousness status > long-term. Multiple repetitions of the --exclude option might be > supportable. I could see that being somewhat useful in scripting. I think "git clean" already takes "-e", but I am not sure if it is meant to do what you wrote above. If "git clean" takes a pathspec, perhaps you can give a negative pathspec to exclude whatever you do not want to get cleaned, something like git clean '*.o' ':!precious.o' to say "presious.o is ignored (hence normally expendable), but I do not want to clean it with this invocation of 'git clean'"?