logoalt Hacker News

dv_dtyesterday at 8:38 PM3 repliesview on HN

what is the advantage of git worktree vs using a git remote set to a local file upstream.


Replies

jamie_cayesterday at 8:52 PM

I'm sure they're roughly equivalent. Parent is probably actually asking: is there native support for managing multiple checkouts/branches for parallel work (and I would add: with lifecycle hooks for create/teardown so I can have dedicated test databases etc).

dagssyesterday at 9:03 PM

As the sibling comments note, this is kind of off-topic to my post.

But I think git worktrees are a bit more ergonomic, I don't have to think about local vs upstream there's just one place to push.

I like to organize my projects like this:

    myproject/.repo/git  # bare repository .. my own convention..
    myproject/main       # worktrees from ../.repo/git
    myproject/feature1
    myproject/feature2
show 1 reply
doolsyesterday at 8:49 PM

What is the advantage of a git remote set to a local upstream vs a git worktree?