Re:Highlights from Git 2.28
by monocularvision on Monday July 27, 2020 @10:43PM
(#23971795)
“Let me share the Good News of git worktrees” is a thing I say often in our work Slack.
What does worktree provide that a fresh local clone doesn't?
Re:Highlights from Git 2.28
by fiddlerwoaroof on Monday July 27, 2020 @10:15PM
(#23971659)
Reduced disk space usage for large repositories. And a convenient way to manage all your clones
I guess it reduces duplicating the history? Large files are by far the bulk of what I personally deal with so it don't think there's a real difference for me but I could see it helping.
Re:Highlights from Git 2.28
by fiddlerwoaroof on Tuesday July 28, 2020 @12:03PM
(#23977153)
Yeah, it only stores the objects in the .git directory once.
Maybe too obvious, but if you’re not pushing everything to the remote, local-only content is available in both worktrees.
If it's a multi-gigabyte repo that you are cloning over a slow VPN, it speeds things up quite a bit.
The `--reference` and `--dissociate` flags to `git clone` can be used to avoid the majority of the network transfer while still creating an independent local repository.
Godsend if you regularly need to work on multiple branches simultaneously.