スキル一覧に戻る
Lordsisodia

using-git-worktrees

by Lordsisodia

SISO Agency Internal Platform - Task management and day tracking system with LifeLock integration

0🍴 0📅 2026年1月19日
GitHubで見るManusで実行

SKILL.md


name: using-git-worktrees category: core-infrastructure/development-tools version: 1.0.0 description: Work on multiple features simultaneously without context switching overhead author: obra/superpowers verified: true tags: [git, workflow, productivity, branching, parallel-development]

Skill: Using Git Worktrees

<when_to_use> ✅ Working on multiple features in parallel ✅ Emergency hotfixes while mid-feature ✅ Code reviews requiring actual build/test ✅ Long-running experiments vs. mainline work ✅ Comparing different branch implementations </when_to_use>

Create worktree for existing branch

git worktree add ../my-project-bugfix bugfix-123

Create with detached HEAD

git worktree add ../my-project-exp experiment --detach </create_worktree>

<list_worktrees>

See all worktrees

git worktree list

See with branch details

git worktree list --porcelain </list_worktrees>

<remove_worktrees>

After merging and cleaning up

git worktree remove ../my-project-feature-a

Or prune deleted worktrees

git worktree prune </remove_worktrees> </basic_commands>

Start feature A

git worktree add ../my-project-feature-a feature/add-user-auth

Start feature B (no need to stash or commit partial work!)

git worktree add ../my-project-feature-b feature/payment-integration

Switch between them by cd'ing, no git operations needed

cd ../my-project-feature-a # Work on auth cd ../my-project-feature-b # Work on payments

Fix, test, commit, push hotfix

cd ../my-project-hotfix

... fix and push ...

Clean up

git worktree remove ../my-project-hotfix

<best_practices> Name worktrees descriptively: ../project-branch-name Keep worktrees in sibling directories to main repo Remove worktrees after merge to avoid clutter Use git worktree prune regularly Each worktree has its own git stash, index, and working state </best_practices>

<integration_notes> <claude_integration> When managing parallel work, say:

  • "Create a worktree for [feature] while I finish [current work]"
  • "Help me clean up old worktrees"
  • "Set up worktrees for reviewing PRs 123, 124, and 125"

Claude will:

  • Manage worktree creation and cleanup
  • Help organize parallel workflows
  • Prevent merge conflicts from context switching
  • Suggest optimal worktree organization </claude_integration> </integration_notes>

Work on auth

cd ../my-project-feature-a

Make changes, commit, push

Switch to payments (no stash needed)

cd ../my-project-feature-b

Make changes, commit, push

Cleanup after merge

cd ~/dev/my-project git worktree remove ../my-project-feature-a git worktree remove ../my-project-feature-b

Hotfix comes in

git worktree add ../my-project-hotfix hotfix/critical-security

Fix the hotfix

cd ../my-project-hotfix

Make fix, test, commit, push

Back to feature work (no context switching!)

cd ~/dev/my-project

Continue where you left off

Cleanup

git worktree remove ../my-project-hotfix

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です