Experiment on your code freely with Git worktree

13 points by felixyz


op

i wrote about worktrees 0 a couple years ago (and even integrating this easily with fzf!). however, i quickly began to find deficiencies in this flow: firstly, tools like cargo and npm create a directory specific cache (target or node_modules), and it was non-trivial to share this across worktrees (cargo cache is polluted by current working directory unfortunately). secondly, worktrees work poorly with git-submodules. and by poor, i mean do not work at all. you have to re-init submodules for every worktree you create.

i have since then switched to a “branchless” flow with jujutsu.