Sounds like the worktree feature in git: https://git-scm.com/docs/git-worktree
Worktrees let you have different branches from the same repo checked out to the file system at the same time, without needing seperate repos.
The clone --shared --reference-if-able and -dissociate options let you have multiple repos with less of a space hit.
They almost certainly can be used at the same time, though I've never heard of anyone doing so.
The limit of only having at most a single copy of each branch checked out, which makes sense for development purposes, made worktrees unsuitable for my use, which was mostly (ab)using git as a deployment tool.