From ad7811e99108abd0a6785d1ba5c08852fa6ede02 Mon Sep 17 00:00:00 2001 From: grindhold Date: Wed, 26 Aug 2015 21:58:22 +0200 Subject: [PATCH] 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. --- bin/git-clear | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 bin/git-clear diff --git a/bin/git-clear b/bin/git-clear new file mode 100755 index 0000000..9f081b0 --- /dev/null +++ b/bin/git-clear @@ -0,0 +1,5 @@ +echo "Sure? [Y/n]" +read ans +if [ "$ans" != "n" ] + then git ls-files --others --exclude-standard | xargs rm ; git reset --hard +fi