‹ 首页

git-worktree

@sammyjoyce · 收录于 昨天 · 上游提交 2 个月前

Manage Git worktrees for isolated parallel development. Use when you want a clean branch/worktree without stashing or when reviewing in isolation.

适合你,如果需要在同一仓库中同时处理多个分支或隔离审查代码

/ 通过 npx 安装 校验哈希
npx oh-my-skill add sammyjoyce/pi-compound-engineering/git-worktree
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- sammyjoyce/pi-compound-engineering/git-worktree
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify sammyjoyce/pi-compound-engineering/git-worktree
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
0GitHub stars
~248最小装载
~2K含声明引用
~2K文本包总量
索引托管

怎么用

技能原文 SKILL.md作者撰写 · MIT · b4eff36

Git Worktree Manager

This skill ships a helper script:

  • scripts/worktree-manager.sh

It wraps git worktree and also:

  • keeps worktrees under .worktrees/
  • copies common .env* files from the main repo into new worktrees
  • ensures .worktrees/ is in .gitignore
Usage
Create a worktree
bash scripts/worktree-manager.sh create <branch-name> [from-branch]

Example:

bash scripts/worktree-manager.sh create feat-login main
List worktrees
bash scripts/worktree-manager.sh list
Switch (prints target path)
bash scripts/worktree-manager.sh switch <branch-name>
Copy env files into an existing worktree
bash scripts/worktree-manager.sh copy-env <branch-name>
Cleanup inactive worktrees
bash scripts/worktree-manager.sh cleanup
Notes
  • Prefer using this script instead of calling git worktree add directly.
  • If your default branch is not main, pass it explicitly as from-branch.
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。