I often switch branches and compile my project, and I have a git worktree so I have work on two branches at the same time (ex: current code and PR review). However, Xcode is currently setup to use one DerivedData location.
Would it be better to specify a DerivedData folder for each branch? Or at least for each git worktree?