tj.git-extras/bin/git-clear
grindhold ad7811e991 implemented git-clear
i wanted a simple command to restore the state of a repo as if it was
freshly cloned with the current HEAD. This is basically git reset --hard
with deletion of all untracked files that are in the repo.
2015-08-26 21:58:22 +02:00

6 lines
133 B
Plaintext
Executable file

echo "Sure? [Y/n]"
read ans
if [ "$ans" != "n" ]
then git ls-files --others --exclude-standard | xargs rm ; git reset --hard
fi