Last Updated: February 25, 2016
·
6.001K
· arunprasath

Git: remove untracked files and directories

Use git clean

Below command is for dry-run

$ git clean -n -d
options:
-d => remove untracked directories

Below command will remove all untracked files as well as directories

$ git clean -d -f

Below command will remove only files ignored by git

$ git clean -X