mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
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.
This commit is contained in:
parent
dae750f734
commit
ad7811e991
5
bin/git-clear
Executable file
5
bin/git-clear
Executable file
|
|
@ -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
|
||||
Loading…
Reference in a new issue