Feature request for product/service
Cursor IDE
Describe the request
When I start a new local agent session and select a different branch (e.g. main) while the workspace has uncommitted changes on the current feature branch, Cursor forces me to Discard or Commit those changes. There is no option to just switch branches and keep the dirty working tree.
That is unnecessarily strict. In a normal terminal, git checkout main often succeeds with uncommitted changes intact when there is no conflict. My current workaround is exactly that: open the terminal, run git checkout main, and continue. Cursor could do the same thing for me.
Why this is painful
- I hit this constantly when jumping between feature WIP and a fresh agent on
main - Discard is dangerous; Commit is often the wrong action for unfinished work
- The only safe UI path today is cancel → manual terminal checkout → retry
- Worktrees/cloud agents are useful isolation tools, but overkill for “just check out main and leave my dirty files alone”
Requested options in the dirty-tree branch-switch dialog
- Switch and keep changes — equivalent to a normal non-conflicting
git checkout <branch>that carries the working tree - Stash and switch (nice-to-have) — stash, checkout, leave stash for later
- Keep existing Commit / Discard for people who want a clean tree
If Git would refuse the checkout due to conflicts, show that error and fall back to stash/commit/discard — don’t pretend carry-over is always unsafe.
Expected behavior
Selecting main for a new agent should be able to perform a normal git checkout main when Git allows it, without forcing me to destroy or commit WIP first.
Operating System (if it applies)
MacOS