tj.git-extras/bin/git-clear-soft
Richard Fearn 82d6a7265f git-{clear,clear-soft,sync}: improve yes/no prompts
Don't print trailing newline; prompt for yes/no response on the same line
2016-11-19 16:41:19 +00:00

8 lines
236 B
Bash
Executable file

#!/usr/bin/env bash
echo -n "Sure? - This command may delete files that cannot be recovered. Files and directories in .gitignore will be preserved [Y/n]: "
read ans
if [ "$ans" != "n" ]
then git clean -d -f && git reset --hard
fi