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.

antigravity350worktree2multi-repo2agent-design2automation42

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-05-31
Keeping Agent Behavior Consistent Across Separate Repositories: Notes on Multi-Repo Governance
How to keep Antigravity agents behaving consistently across several independent repositories when a monorepo isn't an option. A layered governance design with a working distribution script and drift audit, drawn from running four sites in parallel.
Agents & Manager2026-06-15
Calling a Managed Antigravity Agent from the Gemini API: Design Notes on the Preview Model
antigravity-preview-05-2026, now in public preview on the Gemini API, is a Managed Agent that plans, runs code, edits files, and browses the web autonomously inside a sandbox. Here is how it differs from rolling your own orchestration, and where to draw the line.
Agents & Manager2026-06-12
Handing Dependency Updates to Antigravity Agents — Risk Tiers, Verification, and Rollback
How far can you trust Antigravity agents with dependency updates? A four-tier risk model that corrects semver optimism, worktree-isolated lots, a fixed verification script, and a rollback-first ledger — the operations design I settled on while maintaining multiple apps.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →