Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Exactly, but having branches kind of allow you to not have to create local clones. And I legit use rsync to clone locally git repos. The question is : what is the best ?


You can have multiple worktrees per repo. Usually that's the best solution instead of local clones.


The git-worktree man page says:

  BUGS

  Multiple checkout in general is still experimental, and
  the support for submodules is incomplete. It is NOT
  recommended to make multiple checkouts of a superproject.
Source: https://git-scm.com/docs/git-worktree

It complicates git with more cruft. A separate clone is more understandable and independent. If you trash something in its .git/ subdirectory, only that repo is affected.


I'd hardly call it "cruft". Git has a lot of features. Not all of them are useful for all combinations of projects, workflows, and people.

In my use case, independence would be an anti-feature. git-worktree fulfills a specific desire that I cannot fulfill with any known alternative. Therefore I use it.

As for actual bugs, I certainly never encountered any. But I also don't use it with repos that contain submodules, as per the warning.


That's interesting, some kind of meta branches.


This is what I do for complex projects.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: