Skip to content

Instantly share code, notes, and snippets.

@bryhaw2
Created February 6, 2014 06:03
Show Gist options
  • Select an option

  • Save bryhaw2/8839030 to your computer and use it in GitHub Desktop.

Select an option

Save bryhaw2/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