Skip to content

Ask user to bring changes from worktree to main repo #22592

Closed

Description

@Arif-un

The feature request

Whenever I use multiple branches and make changes on one of them, I’m prompted to either bring those changes to the branch or leave them in the current branch. However, this behavior doesn’t occur in the worktree. When I work on different worktrees and switch between them, I don’t receive the same prompt.
Additionally, if I attempt to move a worktree to the main repository, I’m not asked to either bring the changes into the repository or leave them in the current worktree.

Proposed solution

Whenever I attempt to switch worktrees, I anticipate the same behavior as switching branches. The prompt will ask me whether I want to move the changes into the targeted branch or the main repository, or if I prefer to leave the changes as they are.

Additional context

No response

Activity

  1. desktop-triage commented on Jul 22, 2026

    @desktop-triage

    Suggesting the enhancement label here — the issue requests that the "bring changes to branch / leave them here" prompt, which already exists when switching branches, also appear when switching between worktrees or moving a worktree back to the main repository. No duplicates were found for this specific worktree-switching scenario.

    Generated by Issue Triage (skills-driven) for #22592 · 21.3 AIC · ⌖ 5.58 AIC · ⊞ 5.2K · ◷

  2. babakks commented on Jul 24, 2026

    @babakks
    Member

    Thanks for the issue, @Arif-un! 🙏

    The prompt you're referring to is displayed when you're working on a single-branch environment (no worktree), where checking out a different branch may result in overwriting/losing the files in the current working directory. Unlike that, when you're switching to a different worktree, there's no such concern because whatever you have in the current working directory will remain intact since worktrees occupy separate dirs.

    However, if you try switching to a different branch in the same worktree, expectedly you'll see that prompt again, because you're again checking out a different branch into the current directory.

    So, I don't see this as a missing feature in GitHub Desktop and I'm going to close this issue. However, please feel free to comment if you think otherwise.

  3. Arif-un commented on Jul 24, 2026

    @Arif-un
    Author

    Thanks for taking the time to look at this, but I don't think the reasoning fully covers what I'm asking for.

    Your explanation only addresses one of the two things that prompt actually does. When you switch branches in a single-branch checkout, the prompt exists for two separate reasons:

    1. Safety, avoid overwriting or losing uncommitted files in the working directory.
    2. Convenience, let me carry my uncommitted changes over to the branch I'm switching to ("Bring my changes to X").
      You're right that reason 1 doesn't apply to worktrees, since each worktree has its own directory and nothing gets overwritten. But my request is about reason 2, which the worktree flow currently has no equivalent for.

    Example:

    • I have worktree A on feature-a and worktree B on feature-b.
    • I start editing files in A, then realize the change actually belongs on feature-b.
    • In single-branch mode, switching to feature-b would offer to bring those uncommitted changes along.
    • With worktrees, there is no such option. My changes are stranded in A. To move them I have to drop to a terminal and git stash in A, then git stash pop in B, which defeats the point of using Desktop in the first place.

    The same gap applies to the "move a worktree back into the main repo"
    case: there is no prompt to either bring or leave the in-progress changes.

    So this isn't the overwrite-protection prompt being redundant. It's a genuine workflow gap: Desktop lets me relocate uncommitted work between branches in one mode but not the other. Could you reconsider on that basis?

    @babakks

  4. Arif-un commented on Jul 29, 2026

    @Arif-un
    Author

    Following up on my previous comment, I would like to clarify the context and inquire about the decisions made regarding this scenario.
    @babakks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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