Add a worktree and create a new branch from current HEAD.
Section: Worktree Workflows
Create worktree and new branch together
bash
bash
git worktree add -b hotfix ../hotfixExplanation
A fast way to spin up a new isolated working directory for urgent work.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Worktree Workflows
Create a detached worktree at a commit
Check out a specific commit in a new working tree.
Lock a worktree
Prevent a worktree from being pruned or accidentally removed.
Prune stale worktree administrative entries
Clean up references to missing worktree directories.
Create a branch from a stash
Check out a new branch and apply a stash there.