Skip to content

Instantly share code, notes, and snippets.

@jimmyhoran
Last active August 18, 2019 02:00
Show Gist options
  • Save jimmyhoran/849871e5a808c171cef7431dcb477a9a to your computer and use it in GitHub Desktop.
Save jimmyhoran/849871e5a808c171cef7431dcb477a9a to your computer and use it in GitHub Desktop.
Git: Clean untracked things

Git Cleaning

See which files will be deleted.

git clean -n

To delete the untracked files for good.

git clean -f

Some other handy commands to remove untracked things

  • To remove directories, run git clean -fd
  • To remove ignored files, run git clean -fX
  • To remove ignored and non-ignored files, run git clean -fx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment