Update gitconfig: git_pushmulti

This commit is contained in:
2025-04-24 11:10:12 +08:00
parent a6e2aa616c
commit 00e4707b25
3 changed files with 68 additions and 0 deletions

View File

@@ -191,3 +191,17 @@ if ! alias imgcat &>/dev/null && ! functions imgcat &>/dev/null && command -v ma
fi
zinit light mass8326/zsh-chezmoi
# 自動補上 noglob 並禁用 Zsh 的 globbing 解析
function git_pushmulti() {
# 手動處理方括號或括號內容,並進行推送
local remotes="$1"
local branches="$2"
remotes="${remotes//\[/\"[\"}"
remotes="${remotes//\]/\"]\"}"
branches="${branches//\[/\"[\"}"
branches="${branches//\]/\"]\"}"
# 執行 git pushmulti
noglob git pushmulti "$remotes" "$branches"
}