Create new branch and worktree together.
Section: Worktrees, Submodules, and Sparse Checkout
Add worktree and create branch
bash
bash
git worktree add -b fix/login ../repo-fix mainLearn 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 Worktrees, Submodules, and Sparse Checkout