git-worktree
2
总安装量
2
周安装量
#64647
全站排名
安装命令
npx skills add https://github.com/zfael/brn --skill git-worktree
Agent 安装分布
amp
2
opencode
2
kimi-cli
2
codex
2
gemini-cli
2
Skill 文档
Git Worktree Manager
Manage repositories using git worktrees. This allows working on multiple branches simultaneously without switching or stashing.
Concept
~/dev/personal/auto/
âââ my-project/ # Main clone (bare or with default branch)
â âââ .git/
âââ my-project-worktrees/ # Worktrees directory
âââ feature-123/ # Worktree for feature branch
âââ feature-456/ # Another feature branch
âââ hotfix-789/ # Hotfix branch
Quick Reference
| Action | Script |
|---|---|
| Clone repo | scripts/clone_repo.sh <repo_url> [name] |
| Create worktree | scripts/create_worktree.sh <repo_name> <branch_name> |
| List worktrees | scripts/list_worktrees.sh <repo_name> |
| Remove worktree | scripts/remove_worktree.sh <repo_name> <branch_name> |
Workflow Examples
Start working on a JIRA ticket
# Clone if not already done
./scripts/clone_repo.sh https://github.com/org/my-app.git
# Create worktree for ticket
./scripts/create_worktree.sh my-app PROJ-123-new-feature
# Work in the worktree directory
cd ~/dev/personal/auto/my-app-worktrees/PROJ-123-new-feature
Clean up after PR merged
./scripts/remove_worktree.sh my-app PROJ-123-new-feature
Integration
Uses workspace-manager to determine the work directory. Repositories are cloned to <workspace_path>/<repo_name>/ and worktrees are created in <workspace_path>/<repo_name>-worktrees/.