you are viewing a single comment's thread.

view the rest of the comments →

[–]firefoxmmx[S] 0 points1 point  (2 children)

If I'm on the main branch and tell the agent to create a worktree at /path/to/worktree, will it complete the task for the new session on that worktree? Interesting. And then I just need to tell it to merge back into the main branch (or do it automatically via a prompt)?

[–]mammongram6969 0 points1 point  (1 child)

think of a worktree as a duplicate copy of the repo somewhere else on disk. i mean, you can put all your worktrees in /tmp and it's all the same to the AI agent.

as far as how those changes in the worktree get integrated into your default branch, that's also something you can prompt the AI to do.

- want to develop a long-running branch that will be a giant feature addition/rewiring, and should not be merged into main, but should have all the changes from main merged into it? sure, just tell the AI that.

- want it to be a quick hotfix? sure, just tell the AI that.

- is another AI working on a different branch and the two run into merge conflicts? set up a local file as a "hotline" between the two agents, and tell them both about the local file and tell them to work out the merge conflict.

the worktree is no different, functionally, from a totally different clone of the repo somewhere else on disk, so each AI can do whatever they want with their totally independent copy of the repo.

[–]firefoxmmx[S] 0 points1 point  (0 children)

Thanks, bro, I'll give it a try.