You're deep in a feature branch with a half-broken build. Production page is on fire. Switching branches will break your dev server.
git worktree gives you a second checkout in a sibling directory — same repo, different branch.
Medium · 2 steps · +550 XP
This scenario walks through 2 steps, in order:
Try the terminal first — you learn more by doing. When you want to check yourself, here is the command for each step.
git worktree add ../app-hotfix maingit worktree listWorktrees beat stashing for context switches. One repo, many checkouts.