new force-update

This commit is contained in:
Dict Xiong 2022-07-30 13:53:26 +08:00
parent 7a2977a9e0
commit 287e74f9bd

View File

@ -81,7 +81,13 @@ dfs()
{
case $1 in
update ) $DOTFILES/update.sh ;;
force-update ) (cd "$DOTFILES" && git fetch --all && git reset --hard origin/main && git pull) ;;
force-update ) (
cd "$DOTFILES"
git fetch --all
ref=$(__git_prompt_git symbolic-ref --short HEAD 2> /dev/null) || ref=$(__git_prompt_git rev-parse --short HEAD 2> /dev/null) || return 0
for b in $(git for-each-ref refs/heads --format='%(refname)') ; do git checkout ${b#refs/heads/} ; git pull --ff-only ; done
git checkout $ref)
;;
version ) (cd "$DOTFILES" && git rev-parse HEAD) ;;
reset )
antigen reset 1> /dev/null