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
Written by Arun Prasath
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#