This seems to be a quirk of Git and this apparently cannot be solved with a Git configuration change, so it would be nice if Fork could do it automatically.
For example:
- Worktree
A has branch main checked out, worktree B has another branch checked out
- Fetch remote changes with
main having remote changes
- Switch to worktree
B, then fast-forward main
- Switch to worktree
A (which has main checked out) and note that its index has all the necessary changes staged to revert the fast-forward
This is apparently because Git updates the main branch reference to point to the new commit and also updates the working directory files in worktree A to match the new main state. But it doesn’t automatically update worktree A’s index to match. A simple git reset or git reset --mixed HEAD fixes that, but it would be nice if Fork had an option to do that automatically.