mirror of
https://github.com/DictXiong/dotfiles.git
synced 2025-07-01 21:00:29 +08:00
new force-update
This commit is contained in:
parent
7a2977a9e0
commit
287e74f9bd
8
.zshrc2
8
.zshrc2
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user