1. If you already have a normal Git repository locally, the simplest way to use Git worktree is to start there (and it’s personally how I prefer to use worktree).
Add a new worktree and create a new branch:
git worktree add ../<new-folder-and-branch-name>
You can also add a new worktree from an existing branch (that’s not already checked out):
git worktree add ../<new-folder-and-branch-name> <branch>
You now have a folder for just one branch—an advantage in many cases, e.g.: updating/changing NPM packages, keeping WIP without committing or fixing a bug for production.
2. If you’re doing a fresh clone, you can clone it as a
--bare repository and add worktrees for each branch you’re working on:
git clone --bare <repository> <new-directory-name> git worktree add <branch>
Each branch will then be a folder in the Git repository folder.