• atzanteol@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    4
    ·
    17 days ago

    It’s more space efficient - you don’t get another full copy of the repo. The worktree points back to the same .git directory.

    And since it’s in the same repo you can diff between branches with other worktrees without needing to setup remotes for each of them.

        • SpaceNoodle@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          17 days ago

          Then why mention setting up remotes? Why would multiple worktrees help if a worktree is not necessary for the functionality?

          • atzanteol@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            3
            arrow-down
            1
            ·
            17 days ago

            The question I was answering was about worktrees vs. multiple clones. With multiple clones you need to setup remotes to share branches between directories. With worktrees sharing a working copy you don’t.