Git worktree basics

Worktrees allow multiple working directories attached to a single repository. I think of a worktree as a sort of checked out instance of a repo.
Instead of having multiple folders of the same repo checked out on your disk, you could use worktrees for the same benefits. There's more seperation than with branches.

To create a new worktree from an existing branch:
git worktree add <branch>

You will need to supply a name for the worktree or if you pass it a branch name it will create a worktree checked out to the branch passed it named after the branch.

Worktrees are created relative to the the current directory, so if you want to create a worktree at the same level as your current directory (which you probably do) you should prefix your name with ../ .

To list worktrees:
git worktree list

And, to remove them:
git worktree remove <worktree name>

The slightly counterintuitive bit is checking out to a worktree. Each worktree is its own directory, so to 'check it out' you use cd.