跳过导航
Cursor now natively supports git worktrees.
0:00 / 0:42

Cursor now natively supports git worktrees.

Lee Robinson

@leerob30万 位关注者

在 X 上查看
1,244 个赞下载原帖

157,784 次观看

Cursor now natively supports git worktrees. You can run multiple agents in parallel, each with their own isolated copy of the codebase. This is great for comparing models or running the same model multiple times and picking the best result.

47 条评论

评论来自 X (Twitter) 上的原帖

  • arun singh 的头像

    @arunsingh_I

    I think use cases are greatly exaggerated. It may be good for experimentation but for anything production you would not be validating multiple outputs. Worst you will find one model did something right and the other did something else right, you cant pick parts.

    11 个赞

  • Lee Robinson 的头像

    @leerob

    It's worked pretty well for us internally. I often find myself either choosing from the best run of a few agents, or pulling in one piece the others missed and merging them locally.

    12 个赞

  • arun singh 的头像

    @arunsingh_I

    Ohhh man if merging was that easy, i hardly see code like that where you can just merge piece quickly. Great if its working for you.

    5 个赞

  • Anthony Isaacson 的头像

    @burbabull

    this feature was kinda confusing I expected it to let me make a plan, then use multiple agents to execute parts of it repeating work with different models is more of a “test drive” vs daily driver scenario

    9 个赞

  • Duncan 的头像

    @ephraimduncan

    been using it, works really well

    5 个赞

  • Jeffrey Emanuel 的头像

    @doodlestein

    I really think worktrees are a bad pattern and not worth the trouble. There are other, much better ways at getting multiple agents to work well together at the same time that don’t come with the overhead and reconciliation burden of worktrees.

    5 个赞

  • Lee Robinson 的头像

    @leerob

    If you prefer the alternative, which is running multiple agents in isolation in the cloud (virtual machines), that is a single dropdown away 😄

    2 个赞

  • Jeffrey Emanuel 的头像

    @doodlestein

    I prefer using my new tool, which also works with cursor, which handles the problem via agent direct communication and a system of file reservations:

    3 个赞

  • Tom Bielecki 的头像

    @tombielecki

    @leerob This is an interesting comms/coordination paradigm between agents doing different tasks. But I wonder why we haven’t seen pair programming with different LLMs where they critique/review each other’s code at every step.

    1 个赞

  • Jeffrey Emanuel 的头像

    @doodlestein

    @leerob Yeah I agree that would be a useful workflow. I do mimic they with my agent mail system, it’s just not an explicit pairing up and it’s not in real time. I just periodically tell some of the agents to switch hats and start reviewing recent code from other agents.

  • Shrey Gupta 的头像

    @shreygups

    i just tried this how can i open the worktree in the ide

    5 个赞

  • Lee Robinson 的头像

    @leerob

    For each run, you can click "apply changes"! You can also open terminals for each worktree if you want.

    2 个赞

  • Shrey Gupta 的头像

    @shreygups

    gotcha! cool the terminal helps so i can open cursor in another window but feel like there should be a simpler way if i'm already doing setup commands for new worktrees

    1 个赞

  • COURT 的头像

    @BDoma

    Lee do you have something like Cursor.learn explaining worktrees? I use Git regularly but have never used worktrees. I find your style of teaching my favorite! ❤️

    5 个赞

  • Lee Robinson 的头像

    @leerob

    I'd like to make this!

    6 个赞

  • Six 的头像

    @buildwithsix

    this is great, especially as the models continue to progress and even specialize. To build on this, I'd love to have each permutation viewable in the browser so I can compare the results from a user's perspective. Thanks for continuing to make cursor an awesome tool!

    3 个赞

  • Lee Robinson 的头像

    @leerob

    This is doable, especially if you're using something like Next or Vite which have incrementing port numbers. You can open a terminal for each worktree and each has a unique port.

    7 个赞

  • Six 的头像

    @buildwithsix

    Ah, that makes sense, I'll have to give that a shot. Thanks Lee for the response, and for your great work on Cursor w/ the community.

    1 个赞

  • Atlyr 的头像

    @Atlyr_

    Can I plan and give mutually exclusive work streams to different agents in parallel?

    3 个赞

  • agusti 的头像

    @bleuonbase

    this is a fine idea but the execution feels … not there yet there should be a worktree tool the regular agent can call to reconcile and act as orchestrator/merger back otherwise you end up with 4 just slightly different implementations i literally told it to use the cli to

    2 个赞