You don’t need to do a full clone to have multiple working copies of your repo checked out. You can use the git worktree command to create these working copies:
You don’t need to do a full clone to have multiple working copies of your repo checked out. You can use the git worktree command to create these working copies:
For big repositories with long histories (like Qt), worktrees also save some disk space.
I’ll grant that saving disk space is a concern for many - not for me - the largest repo I use is 2-3 million LOC with about 10 or 15 years history and the 4-5GB per clone doesn’t bother me.
Right but that's quite a lot more faff than not having to do anything at all.
A task could be any small thing that requires its own checkout for some possibly stupid reason, like running the regression tester or temporarily running an old version of a binary out of your dev checkout over NFS if there was a bad deploy.
https://www.git-scm.com/docs/git-clone#Documentation/git-clo...
Sure, you can change back origin to point to the central one again, but you still have to do a dance to sync branches among your local clones (and I’m not sure what happens to the hardlinks).
worktrees just naturally basically are “views” of the same local repository, which may hang off a central repository (or not).
Also, all branches stay in sync between worktrees. For example, I do git fetch on one worktree, and remote branches are up to date on all of them.
The only downside is that they don't work with submodules, if you are unfortunate enough to be using submodules.