Git already has a similar feature. It's called worktree https://git-scm.com/docs/git-worktree
For example: `git worktree add <folder> <commit-hash>` checks out that commit in that folder.
For example: `git worktree add <folder> <commit-hash>` checks out that commit in that folder.
And they’re something of a pain in the ass to manage as you can’t have two worktrees to the same branch.
So for temporary querying across a few branches doing clones is a lot easier (git will hardlink when cloning on the same FS so performances are not an issue, and you can just delete the scratch clones afterwards without the need to prune the worktrees), and if you regularly need to query things across a lot of branches worktrees are unusable.
This saves me from throwing away my working copy when I switch to a different task;
/source/repos/AcmeCorp 2fddd74f9a [bug/CurrentWork]
/source/repos/AcmeCorp-hotfix 27175cf6c5 [hotfix/2023-11-27.1]
/source/repos/AcmeCorp-master 016ca20b75 [master]
/source/repos/AcmeCorp-reference 454be5348d [feature/RecentReviewedWork]
/source/repos/AcmeCorp-release 95027177d7 [release9.12.0]