
git-worktree
Git worktree を使った複数ブランチの同時作業管理。 使用タイミング: (1) 複数機能を並行開発したい時 (2) PRレビュー中に別作業したい時 (3) 本番ホットフィックスと開発を同時進行したい時 (4) worktreeの使い方を知りたい時。 トリガー例: 「worktreeで」「別ブランチを同時に」「並行開発したい」 「PRレビューしながら開発」「ホットフィックス用のworktree」
- Installs
- 63
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/kimny1143/claude-code-template --skill git-worktree- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads git-worktree automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
git-worktree - Git Worktree 操作
複数ブランチを同時に作業するための Git worktree 管理。
概要
Git worktree を使うと、1つのリポジトリから複数の作業ディレクトリを作成できる。
メリット:
- ブランチ切り替えなしで複数機能を並行開発
- PRレビュー中に別作業が可能
- 本番ホットフィックスと開発を同時進行
基本コマンド
Worktree 作成
# 新規ブランチで作成
git worktree add ../project-feature-x feature-x
# 既存ブランチで作成
git worktree add ../project-hotfix hotfix/urgent-fix
# リモートブランチをチェックアウト
git worktree add ../project-review origin/feature-y
Worktree 一覧
git worktree list
出力例:
/path/to/project abc1234 [main]
/path/to/project-feature def5678 [feature-x]
/path/to/project-hotfix ghi9012 [hotfix/urgent-fix]
Worktree 削除
# 作業ディレクトリを削除
rm -rf ../project-feature-x
# Git から登録解除
git worktree prune
または一括:
git worktree remove ../project-feature-x
ワークフロー例
1. 機能開発中にホットフィックス
# 現在: feature-x ブランチで開発中
# 緊急: 本番バグ発生
# ホットフィックス用 worktree 作成
git worktree add ../project-hotfix -b hotfix/login-fix main
# ホットフィックス作業
cd ../project-hotfix
# ... 修正 ...
git commit -m "fix: resolve login issue"
git push origin hotfix/login-fix
# 元の作業に戻る
cd ../project
# feature-x の作業を継続
2. PRレビュー
# レビュー対象のブランチを worktree で開く
git fetch origin
git worktree add ../project-review origin/feature-y
# レビュー
cd ../project-review
npm install
npm run dev
# レビュー完了後
cd ../project
git worktree remove ../project-review
ベストプラクティス
ディレクトリ命名
project/ # メイン (main)
project-feature-x/ # 機能開発
project-hotfix/ # ホットフィックス
project-review/ # PRレビュー
定期クリーンアップ
# 不要な worktree を確認
git worktree list
# マージ済みブランチの worktree を削除
git worktree remove ../project-merged-feature
# 孤立した worktree を整理
git worktree prune
注意点
- 同じブランチを複数 worktree で開けない
- node_modules は各 worktree で別途インストール必要
- .env ファイルもコピーが必要
トラブルシューティング
"already checked out" エラー
# 別の worktree で使用中のブランチ
git worktree list # どこで使われているか確認
孤立した worktree
# ディレクトリを手動削除した場合
git worktree prune
ブランチ削除時
# worktree で使用中のブランチは削除できない
# 先に worktree を削除する
git worktree remove ../project-feature
git branch -d feature
FAQ
What does the git-worktree skill do?
Git worktree を使った複数ブランチの同時作業管理。 使用タイミング: (1) 複数機能を並行開発したい時 (2) PRレビュー中に別作業したい時 (3) 本番ホットフィックスと開発を同時進行したい時 (4) worktreeの使い方を知りたい時。 トリガー例: 「worktreeで」「別ブランチを同時に」「並行開発したい」 「PRレビューしながら開発」「ホットフィックス用のworktree」
How do I install git-worktree?
Run npx skills add https://github.com/kimny1143/claude-code-template --skill git-worktree in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/git-worktree/ (personal) or .claude/skills/git-worktree/ (project).
Which AI agents can use git-worktree?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is git-worktree safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains git-worktree?
It is published by kimny1143 in kimny1143/claude-code-template. It has 63 recorded installs.
More from kimny1143/claude-code-template
ui-ux-pro-max
kimny1143/claude-code-template
UI/UX design intelligence. Plan, build, design, implement, review, improve UI/UX code. Styles: image-first, editorial design, minimalism, dark mode, responsive. Projects: landing page, dashboard, SaaS, mobile app.
remotion
kimny1143/claude-code-template
Open the skill to read its SKILL.md instructions.
ux-psychology
kimny1143/claude-code-template
Open the skill to read its SKILL.md instructions.
copywriting
kimny1143/claude-code-template
Open the skill to read its SKILL.md instructions.
ios-app-store-submission
kimny1143/claude-code-template
Open the skill to read its SKILL.md instructions.
marketing-psychology
kimny1143/claude-code-template
Open the skill to read its SKILL.md instructions.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.