Fleet 1.13:Teams are now shipping 5x more PRs with autonomous pipelines.See what's new →
FleetFleet
Glossary

Git Worktree

A Git worktree is an additional working directory linked to an existing Git repository, allowing multiple branches to be checked out simultaneously in separate directories without cloning the repository again.

Standard Git allows only one working directory per clone. If you need to work on two branches simultaneously — say, a feature branch and a hotfix — you have to either stash changes, use multiple clones, or switch back and forth. Git worktrees solve this by creating additional working directories that share the same .git object store and history while having independent branch checkouts and working trees.

For AI agent workflows, worktrees are valuable because each agent can work in its own directory without interfering with other agents or the developer's current working state. Agent A checks out feature/payments in /repo-worktrees/feature-payments; agent B checks out feature/auth in /repo-worktrees/feature-auth. Both agents run simultaneously without interfering with each other or with the developer's main checkout.

Worktrees share the object database, so creating one is nearly instantaneous and takes no additional disk space for the history — only the working files. This makes them practical to create and destroy per-task rather than per-project.

How this relates to Fleet

Fleet uses Git worktrees to isolate concurrent agent work. When multiple developer agents are active on the same repository, each operates in its own worktree, preventing filesystem conflicts between agents working on different branches simultaneously. Fleet's worktree management is handled automatically during agent setup.

Frequently asked questions

Are Git worktrees the same as submodules?

No. Submodules are separate repositories included within another repository. Worktrees are additional working directories for the same repository. A worktree shares all commits, branches, and history with the main working directory; a submodule is an independent repository with its own history.

Are there any limitations to Git worktrees?

Each branch can only be checked out in one worktree at a time — you cannot have two worktrees on the same branch simultaneously. Some older Git hooks and tools do not correctly detect that they are running in a worktree context rather than the main clone. These limitations are rarely encountered in normal agent workflow use cases.

Run your first agent fleet

One binary. Five minutes. See every agent, coordinate every handoff, and keep a full audit trail of what your fleet did.