You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ask user to bring changes from worktree to main repo #22592
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.
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.
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.
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:
Safety, avoid overwriting or losing uncommitted files in the working directory.
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?
Activity
desktop-triage commentedon Jul 22, 2026
Suggesting the
enhancementlabel 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.babakks commentedon Jul 24, 2026
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.
Arif-un commentedon Jul 24, 2026
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:
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:
feature-aand worktree B onfeature-b.feature-b.feature-bwould offer to bring those uncommitted changes along.git stashin A, thengit stash popin 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
Arif-un commentedon Jul 29, 2026
Following up on my previous comment, I would like to clarify the context and inquire about the decisions made regarding this scenario.
@babakks