◉ANTIGRAVITY LABJP
Articles/Antigravity Basics
◉ Antigravity Basics/2026-06-15Advanced

Running Multiple Repositories in Parallel with Antigravity 2.0 Projects and Worktrees

Combining Antigravity 2.0 projects with git worktrees to run several repositories in parallel safely. From isolating agent workspaces to avoiding conflicts and connecting to scheduled execution, organized from real work.

antigravity476worktreemulti-repoagent-design10automation96

✦ Premium Article

When you open several repositories in one editor, telling an agent "touch only this repository" turns out to be harder than expected. If two agents run on the same working directory, one's writes break the other's assumptions. As an indie developer running four sites in parallel, this was a daily problem for me.

Combining Antigravity 2.0 projects with git worktrees lets you solve this "workspaces bleed into each other" problem structurally. The idea is to align the logical unit (project) with the physical unit (worktree), giving each agent a closed sandbox. This article organizes that layout with the texture of real work.

The whole layout in one line

Before the details, the aim in one line is to "align three things per repository: the logical (project), the physical (worktree), and the permission (lock)."

The unit of work the agent perceives, the directory where files actually live, and the scope of the lock that stops simultaneous writes. When these three are misaligned, parallel operation breaks quietly. When they align, adding agents does not collapse it. From here, we assemble these three layers in order.

Why worktrees

A git worktree is a mechanism for carving multiple working trees out of a single repository. Because you can hold a separate directory per branch, you can experiment in another working tree while touching main, without switching branches.

In agent operation, this pays off. In an environment where files get rewritten every time you cross branches, the footing of parallel agents is unstable. Carve a worktree and each agent sees only its own dedicated directory.

# Carve working trees out of one repository
cd ~/repos/antigravitylab.net
git worktree add ../wt/antigravity-feature-a feature-a
git worktree add ../wt/antigravity-feature-b feature-b
 
# Inspect the carved trees
git worktree list

Now feature-a and feature-b exist in separate directories. Writing files in one is unrelated to the other. Only the .git substance is shared; the working files are fully separated.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦A layout that physically isolates agent workspaces with projects and git worktrees
✦The conflicts that arise when several agents run in parallel, and the implementation to avoid them
✦The traps I actually hit in parallel operation, and the operating rules I settled on
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

◉ Antigravity2026-11-16
Choosing Between Orchestrator, /swarm, and /run-workflow by the Shape of the Work
Orchestrator, /swarm, and /run-workflow all landed in Antigravity within one week of November 2026. Instead of picking by model strength, I pick by the shape of the task: is there one decision that spans everything, are the items independent, do the workers need to talk mid-task? Here are those three questions, plus what I check in a workflow script before approving it.
◉ Antigravity2026-10-24
The File Is Right There, but Linux Says "No Such File" — Check the Interpreter, Not the Path
When agy's grep search fails on Linux and the log says "no such file or directory" for a file that clearly exists, the culprit is the ELF interpreter. Here is how to confirm it, reproduce it, and work around it for now.
◉ Antigravity2026-10-20
NoClassDefFoundError on Old Android Devices Only — Four Clues I Gather Before Handing It to an Agent
Everything works on new phones, but Android 6 devices crash. Using a Supplier NoClassDefFoundError that appeared after a Glide update, this note covers the order of diagnosis, the coreLibraryDesugaring setup, and what to prepare before asking an agent to investigate.