I have a local git repo that I cloned from a remote (github, say). The branches in this have associated upstreams that they pull and push from.
I'd like to make a new local copy of this repo so that I can be simultaneously developing on different branches locally.
I could just
git clone …
cp -r repo repo-clone
For this you do the clone form the remote as usual, but you add
--reference <local repository> to use the Git objects from the local repository instead of downloading them from the remote. This will use the objects from the reference repository and not copy them, so it could happen that some Git cleanup deletes objects that you need in your second clone if you e. g. delete a branch in the reference repository that is still in the new repository and the commits are not reachable anymore in the reference repository. If you want to spend additional diskspace to overcome this, use additionally
--dissociate to actually copy the objects from the reference repository.
If you actually don't want a new clone, but just checkout multiple worktrees for different branches, you might also consider using `git worktree' instead.