Skip to content

Instantly share code, notes, and snippets.

@pfrozi
Created May 26, 2017 21:16
Show Gist options
  • Save pfrozi/822e62df144fe39518ea55da3da2ca36 to your computer and use it in GitHub Desktop.
Save pfrozi/822e62df144fe39518ea55da3da2ca36 to your computer and use it in GitHub Desktop.
#!/bin/bash
git reset --hard # removes staged and working directory changes
## !! be very careful with these !!
## you may end up deleting what you don't want to
## read comments and manual.
git clean -f -d # remove untracked
git clean -f -x -d # CAUTION: as above but removes ignored files like config.
git clean -fxd :/ # CAUTION: as above, but cleans untracked and ignored files through the entire repo (without :/, the operation affects only the current directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment