Still a work in progress, but I've published the first draft of a new chapter on "Using Git with coding agents" https://simonwillison.net/guides/agentic-engineering-patterns/using-git-with-coding-agents/
Using Git with coding agents - Agentic Engineering Patterns

Using Git with coding agents - Agentic Engineering Patterns

Simon Willison’s Weblog
@simon are git worktrees often used with agents? I find myself using the main working directory and an OpenCode instance messing around with a separate worktree