git-worktree

star 1

該 skill 用於建立 git worktree

z0890142 By z0890142 schedule Updated 1/21/2026

name: git-worktree description: 該 skill 用於建立 git worktree

git-worktree

規則

  1. 使用以下 Bash 取得當前 branch
    BASE_BRANCH=$(git branch --show-current)
  1. worktree 命名規則
wt-${openspec proposal name}-{date}
  1. 透過以下方式建立 worktree
BASE_BRANCH=$(git branch --show-current)
WT_BRANCH=wt-${openspec proposal name}-{date}

git worktree add worktrees/$WT_BRANCH -b "$WT_BRANCH" "$BASE_BRANCH"
  1. 建立完成後需要同步將 claude/settings.local.json 一並複製到 worktree

worktree 命名規則

錯誤處理:

  • 使用既有 branch,但確保 reset 到正確的基礎分支
  • 避免指向舊的 commit 而缺少必要檔案(如 openspec 資料夾)

worktree structure:

main-repo/
├── .git/
└── worktrees/
    ├── wt-add-auth-system-20260110/
    ├── wt-refactor-api-20260111/
    └── wt-update-docs-20260113/
Install via CLI
npx skills add https://github.com/z0890142/Multi-Agent-Orchestrator --skill git-worktree
Repository Details
star Stars 1
call_split Forks 0
navigation Branch main
article Path SKILL.md
More from Creator