Last active
October 6, 2015 06:58
-
-
Save JoshuaEstes/2954584 to your computer and use it in GitHub Desktop.
Oneline to delete all files that are not tracked in t git repository. Use grep if you only want certain files
This file contains hidden or 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
Bash oneliner | |
for file in $(git ls-files --other --exclude-standard); do rm "$file"; done | |
Git Clean, does the exact same thing | |
git clean -df |
git clean -nd
git clean -df
-n
is dry run, -d
is to remove directories, -f-
will remove the file files/folders
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
check out git clean