Git Worktree Parallel Workflow
By Minh Nguyen · Published · Updated
Sets up and later cleans up git worktrees so several branches can be developed side by side with no stashing or branch switching.
Prompt template
## Git Worktree Parallel Workflow Set up git worktrees for the parallel work I describe, and clean them up afterwards. - Repository path: [text: Path of the main checkout] - Branches needed: [textarea: Branch names and the purpose of each] - Base branch: [text: main or develop] - Where worktrees live: [text: A folder outside the repository] - Phase: [dropdown: Set up, Check status, Clean up] - Project needs a build step per tree: [toggle: Yes, No] For set up, create each worktree from the base branch in the chosen folder, one per branch, with a clear folder name, and never touch uncommitted work in the main checkout. Check the folder is ignored or outside the repo so it cannot be committed. When a build step is needed, list what each tree must install or generate. For status, list each worktree with its branch, clean or dirty state and whether it is merged. For clean up, remove only worktrees whose branches are merged or explicitly abandoned, confirm that nothing uncommitted would be lost, then prune stale entries and delete merged branches. Print the exact commands in order, and mark any that are destructive.