Skip to content

Instantly share code, notes, and snippets.

@tonyoconnell
Created February 19, 2013 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonyoconnell/4988720 to your computer and use it in GitHub Desktop.
Save tonyoconnell/4988720 to your computer and use it in GitHub Desktop.
git clean
git clean -f
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.
Note the case difference on the X for the two latter commands.
Unless you specify -f and clean.requireForce is set to "true" (the default) in your configuration, nothing will actually happen, with a recent enough version of git.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment