git-worktrees-create
Create git worktrees for a branch across code/ submodules. Use to start a new branch, check an existing branch into a worktree, or spin up an isolated workspace.
- License 许可
- MIT
- 最近更新
- 2026-10-26
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- git-worktrees-create
- description
- Create git worktrees for a branch across code/ submodules. Use to start a new branch, check an existing branch into a worktree, or spin up an isolated workspace.
02 资源文件 2
- 脚本scripts/create.py2.3 KB
- 脚本tests/test_create.py4.7 KB
03 SKILL.md 正文
Creates <configdir>/worktrees/<branch>/<repo> for each requested submodule under
code/. If <branch> already exists (locally or on the remote) it is
checked out into the worktree; otherwise it is created fresh off the repo's
tracked default branch (from .gitmodules, default main).
Procedure
- Map the user's request to a branch name and a repo list. If the user says
"all repos", pass every name from
all_repos(). - Run:
mise exec -- python3 ${CLAUDE_PLUGIN_ROOT}/skills/git-worktrees-create/scripts/create.py --branch <branch> --repos a,b,c - The script, per repo:
- fetches
origin - checks out
<branch>into<configdir>/worktrees/<branch>/<repo>if it exists locally or on the remote; otherwise creates it offorigin/<tracked-branch> - skips (status
skipped) if a worktree already exists at that path - continues on error; a single repo failure never aborts the others
- fetches
- Relay the printed report table (repo / status / detail) to the user verbatim or summarized. Exit code is non-zero iff any repo failed.
04 同仓库更多 Skills
claudy
d claudy
gamma
Literal line one. Literal line two.
beta
Quoted: description with a colon.
alpha
Folded description that spans two lines and ends here.
worktree-merge
Rebases one subagent's worktree onto the base branch, optionally verifies the rebased tree, fast-forwards it into the worktree that has the base checked out (an epic integration tree or the main checkout), verifies every commit landed, and only then removes the worktree and its branch. Keeps the worktree intact on any conflict, dirty tree, or failed check. Use after a subagent returns work created with worktree-create.
worktree-create
Creates one isolated git worktree for one subagent, at <workbench>/.claude/worktrees/<name>, branched from main with the newest origin/main and local main merged in. Refuses a name already in use so two agents can never share a tree. Use once per implementation or review subagent before dispatching it; pair with worktree-merge to land the work and clean up.