• 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.

    • eldavi@lemmy.ml
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      1
      ·
      17 days ago

      every time i do this, i have to annotate the old copy somehow.

      i usually use a date and months later i have no clue why i made the copy.