Never confuse education with intelligence, you can have a PhD and still be an idiot.
- Richard Feynman -

Git idioms

From Juneday education
Jump to: navigation, search

Remove untracked files

git clean -fx

           Don’t use the standard ignore rules read from .gitignore (per directory) and $GIT_DIR/info/exclude, but do still use the ignore rules given with -e options. This allows removing
           all untracked files, including build products. This can be used (possibly in conjunction with git reset) to create a pristine working directory to test a clean build.

git clean -fX

           Remove only files ignored by Git. This may be useful to rebuild everything from scratch, but keep manually created files.

git status --ignored - list untracked files