Init commit

This commit is contained in:
raccoon
2024-08-19 20:07:36 +05:00
commit 098d5b2b1b
34 changed files with 2888 additions and 0 deletions

24
repo-reset.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/sh -e
cd "$(dirname "$(readlink -f "$0")")"
git rev-parse --is-inside-work-tree >/dev/null
upstream="$(git rev-parse --abbrev-ref "@{u}" 2>/dev/null || true)"
if [ -z "$upstream" ]; then
echo "*** ERROR: No upstream is configured for current branch"
exit 1
fi
echo "Going to reset current branch to: ${upstream}"
echo "*** WARNING: All local changes and commits will be lost!"
printf "\nExecute [Y,N]?"; read -r yn
if [ "$yn" = "${yn#[Yy]}" ]; then
echo "Aborting reset..."
else
git fetch --all
git reset --hard "$upstream"
echo "Done."
fi
exit 0