Added convenience shell scripts

This commit is contained in:
raccoon
2026-03-02 12:06:35 +05:00
parent ec3f4237c4
commit b27ec72efe
7 changed files with 173 additions and 0 deletions

20
repo-discard.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/sh -e
repository="$(dirname "$(readlink -f "$0")")/."
cd "${repository}"
git rev-parse --is-inside-work-tree >/dev/null
echo ""
echo "*** WARNING: The following files were changed and will be reverted:"
git diff --name-only HEAD
printf "\nExecute [Y,N]?"; read -r yn
if [ "$yn" = "${yn#[Yy]}" ]; then
echo "Aborting discard..."
else
git restore "${repository}"
echo "Done."
fi
exit 0