git worktree add ../hotfix hotfix-branch

Category: Git - Advanced

git worktree add ../hotfix hotfix-branch

Check out a branch into a separate working directory

Creates a separate working directory for a different branch — lets you work on two branches simultaneously without stashing.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.