git worktree

Shell
$ mkdir a
$ cd a
$ git init
$ git commit --allow-empty --allow-empty-message -m ''
$ git worktree add ../b
$ ls .git/worktrees/
b
$ rm -rf ../b
$ git worktree prune
$ ls .git/worktrees/
$
git worktree add <path> <branch>
Source

Also in Shell: