Skip to content

Instantly share code, notes, and snippets.

@bryhaw
Created February 6, 2014 06:03
Show Gist options
  • Save bryhaw/8839030 to your computer and use it in GitHub Desktop.
Save bryhaw/8839030 to your computer and use it in GitHub Desktop.
Git: Remove untracked files
git clean -f
Use -n or --dry-run to preview (no going back)
If you want to also remove directories, run git clean -f -d
If you just want to remove ignored files, run git clean -f -X
If you want to remove ignored as well as non-ignored files, run git clean -f -x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment