RANT: I’m so sick of having to think about making my gitrepo clean again. I actually used to take a copy of the directory so I could just blast away the directory if I suspected I was going to end up in a messy git state.

Even git reset hard HEAD¬†(I can’t even remember (or be bothered) trying to check I’ve got the right syntax) ) doesn’t always work – e.g. if you’ve got untracked files you’ve still got to remove them manually.

I finally tracked down the code to completely reset your git repo – the short and intuitive:

git reset --hard && git clean -dfx

Or if you have zsh then simply:


Way to go!


Leave a Reply

Your email address will not be published. Required fields are marked *