mirror of
https://codeberg.org/vlw/dotfiles.git
synced 2026-02-26 10:42:03 +01:00
feat(git): add gitf r to force rollback the last commit
This commit is contained in:
parent
0b5afb1d24
commit
b6a5d0f32b
1 changed files with 13 additions and 0 deletions
|
|
@ -223,6 +223,19 @@ gitf () {
|
|||
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.
|
||||
"sd")
|
||||
# Only supports "master" as branch for now. This could cause unexpected results if a tracked submodule has a different branch or location name
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue