"git clean -xdf" with optional filter

Is it possible to make git clean -xdf using an additional filter? I want to delete all unplayable files, but save files with a specific extension.

+5
source share
1 answer

Use the parameter -eto specify an exception pattern.

Example. This removes all unnecessary files, except those that have the extension .txt:

git clean -xdfe *.txt
+5
source

All Articles