feat: update gitconfig

This commit is contained in:
2025-12-26 11:50:12 +08:00
parent 9d15bcc3c4
commit ddc76e7695
+10 -6
View File
@@ -96,16 +96,20 @@
#git filter-branch -f --env-filter "GIT_AUTHOR_NAME='Laily'; GIT_AUTHOR_EMAIL='i@laily.net'; GIT_COMMITTER_NAME='Laily'; GIT_COMMITTER_EMAIL='i@laily.net';" HEAD
# worktree
# git wt add <路径> <分支名>
# git wt add -b <新分支名> <路径> [基分支名]
wt="worktree"
wta="worktree add"
wtb="worktree add -b"
#wta="worktree add"
#wtb="worktree add -b"
wtr="worktree remove"
wtl="worktree list"
wtp="worktree prune"
# git wtbn feature-login # 新建分支 + worktree
wtbn="!f(){ git worktree add -b "$1" ../"$1"; }; f"
# git wtn bugfix-123 # 自动创建 ../bugfix-123 (使用同名分支)
wtn="!f(){ git worktree add ../"$1" "$1"; }; f"
# 基于分支创建新分支+worktree
# git wtb <分支名> [<基分支名|当前分支>]
wtb = "!f(){ local base_branch=${2:-HEAD}; local clean_name=$(echo \"$1\" | sed \"s/\\//_/g\"); git worktree add -b \"$1\" \"../$clean_name\" $base_branch; }; f"
# 基于指定分支+worktree
# git wta <分支名>
wta = "!f(){ local base_branch=${1:-HEAD}; local clean_name=$(echo \"$1\" | sed \"s/\\//_/g\"); git worktree add \"../$clean_name\" $base_branch; }; f"
[protocol "file"]
allow = always