How do I disable worktree in cursor?

how do I disable worktree in cursor?

4 Likes

No responses in 12 days? What? This software sucks so hard. Tell us how to shut it off. Somebody? Do staff ever look at this?

Are you trying to use multiple agents?

OR:

Just remove git folder, it will disable worktrees
rm -rf .git

DO NOT delete your .git folder when trying to disable worktrees.

@sabriguenes lease don’t tell people to delete their entire .git folder as a solution to worktrees. That’s some of the worst advice I’ve ever seen.

There are many reasons why someone would want to continue using git whilst trying to escape worktree state.

Cursor’s worktree implementation is pretty poorly done, though, so after using it for a bit, I’m going to steer clear until its matured.

What are worktrees, how to “escape” the worktree in cursor

Anyway, to leave the worktree it’s sort of tricky but here’s some advice:

What is a worktree

  • a worktree is really just a git term for “the git repo has been checked out to a given folder (tree), in a given “working” state
  • In other words, a worktree is just the code in your git repo, at some path
  • When you “git clone” a repo to a path, and look at the files inside, you’ve actually just set up a worktree, it’s just very simple (there’s one worktree- and its at the path you jsut cloned the repo to)
  • The most simple case is oyu only have one worktree- the “root” workktree, at the folder where you cloned the repo
  • its possible to have other worktrees checked out to different locations, so you can have different versions of the code at once
  • When cursor sets up worktrees for you, it checks them out to a special location, and then the agent does all its edits in that worktree

How to escape the agent worktree

  • Cursor’s current implementation of this actually sucks, so often we want to go back to using one worktree, the ‘root’ worktree
  • the easiest thing to do is press “apply” from the agent’s chat, it should update hte “root” worktree with the state of the agent’s worktree
  • Now, in the agent chat box, next to agent / auto, make sure that “local” is chosen instead of the little git branch icon. “local” probably has a laptop icon