logoalt Hacker News

hyfgfhtoday at 8:45 AM2 repliesview on HN

Sorry git worktrees are a waste of time Just keep multiple copies of the repo


Replies

menaerustoday at 9:51 AM

Worktrees are significantly faster to use and checkout than clones. They also use much less disk space, and obviously commits made in one worktree do not require git plumbing to get them visible in another etc.

show 1 reply
dv_dttoday at 9:36 AM

I don't understand why worktrees either, but to each their own.

For my purposes, the alternative with just switching branches or if parallelism is needed, full repos and remotes (including local path remotes) is just much more flexible. Clone local, branch it, optionally do anything later: push a branch back to the local repo, push it to a remote, delete local repo done.

The actual code and clean merges is much more significant than worktrees vs full clones