mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
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.
6 lines
133 B
Plaintext
Executable file
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
|