git worktree
安全複数作業ツリーの並行利用
git worktree add <path> <branch>
1リポジトリから複数の作業ディレクトリを展開。レビューと開発を並行したり、stashせず緊急対応に切替できる。
実行例
git worktree add ../hotfix hotfix/crash別ディレクトリでhotfixを開く
書式
git worktree [add|list|remove] <path> [branch]
実行前の注意
removeで後片付けを忘れずに。
関連コマンド
- git stash作業を一時退避
- git switchブランチ切替(新方式)
- git cloneリポジトリ複製