feat(git): add gitf r to force rollback the last commit (#115)

Reviewed-on: https://codeberg.org/vlw/dotfiles/pulls/115
This commit is contained in:
Victor Westerlund 2026-02-24 13:44:40 +01:00
parent 0b5afb1d24
commit 75eb66197e

View file

@ -223,6 +223,19 @@ gitf () {
git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D
;; ;;
"r")
local confirm
read -p "Type 'y' to confirm force rollback of last commit: " confirm
if [ "$confirm" != "y" ]; then
echo "Aborted"
return 0
fi
git reset --hard HEAD^
git push -f
;;
# Update all git submodules in this repo. "sd" for submodule download. # Update all git submodules in this repo. "sd" for submodule download.
"sd") "sd")
# Only supports "master" as branch for now. This could cause unexpected results if a tracked submodule has a different branch or location name # Only supports "master" as branch for now. This could cause unexpected results if a tracked submodule has a different branch or location name