Skip to content

Add option to reset index when updating branch that is checked out in a different worktree #2521

@marcomasser

Description

@marcomasser

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions