Howto git to a tabula rasa

git reset --hard undoes any changes to tracked files in your working directory and restores them to their versions at head of the branch. However, it doesn't remove untracked files from the working directory. For that you need git clean -x -d -f. To blow away all the cruft in your working directory and restore it to a pristine state, you need to do both.

cat > ~/bin/gitnuke
git reset --hard
git clean -x -d -f

No comments:

Post a Comment