this post was submitted on 26 Jul 2024
32 points (100.0% liked)

Git

2874 readers
12 users here now

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Resources

Rules

  1. Follow programming.dev rules
  2. Be excellent to each other, no hostility towards users for any reason
  3. No spam of tools/companies/advertisements. It’s OK to post your own stuff part of the time, but the primary use of the community should not be self-promotion.

Git Logo by Jason Long is licensed under the Creative Commons Attribution 3.0 Unported License.

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] sgt_hulka@lemmy.sdf.org 3 points 3 months ago (10 children)

I guess I don't understand this feature. Is there an advantage in using worktrees rather than multiple clones? Is it mainly for IDE integration?

The different worktrees share the same .git state. The article has an example where the author uses one tree for writing code and one for fuzzing it. If they used multiple clones they'd have to push from the writing directory and pull from the fuzzing directory to get new commits to fuzz but with worktrees this state synchronization between different git directories happens automatically.

load more comments (9 replies)