Created
February 25, 2017 13:34
-
-
Save thomheymann/41ac54636060b84a743bb7972c5c7598 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# `git clean` seems to ignore -e option when used with -X so had to replicated its behaviour using `git ls-files` | |
# only remove ignored files / folders | |
git clean -Xd # this works fine | |
git ls-files --directory --others --exclude-standard --ignored | xargs rm -rf # same as above | |
# only remove ignored files / folders but keep node_modules folder | |
git clean -Xd -e node_modules # exclude option is ignored | |
git ls-files --directory --others --exclude-standard --ignored | grep node_modules --invert-match | xargs rm -rf # this works fine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment