Blog

Separate worktrees do not separate everything

Git worktrees give each coding task its own working directory and branch. They still share repository history and can depend on the same services. Most parallel-agent surprises happen at those shared boundaries.

Last updated: · By Ubra maintainers

Two panes can still edit one checkout

Check the directory before permitting edits. Separate terminals are not separate worktrees. Use git worktree list to inspect registered paths and git branch --show-current inside each session. A directory name alone does not prove which branch is checked out.

git worktree list
git branch --show-current
git status --short

Ports and databases remain shared resources

Two development servers can compete for the same port. Two test runs can reset the same database. Use the project’s established configuration for distinct ports and test data, and document which resource each session owns. Do not copy production credentials into a disposable checkout to get around a setup problem.

Dependencies and generated output need a policy

A new worktree may require dependency installation. Follow the repository’s lockfile and package manager. Sharing writable dependency or build directories between concurrent processes can introduce interference; use the project’s supported cache mechanisms instead. Keep environment files ignored and give agents only the access their task needs.

Independent commits can still conflict

Agents can edit different files that depend on the same interface, or both can update a lockfile. Review each change against its task, then test the combined state. After landing one branch, update the next before merging. Do not treat a clean textual merge as evidence that runtime behavior still works.

Cleanup must preserve work

Stop the session, inspect the worktree and preserve intended changes before removing it. Git’s normal worktree removal refuses dirty state; do not add force simply to make cleanup succeed. Branch deletion is a separate decision after the result has been integrated or intentionally abandoned.

git -C ../docs-links status --short
# After committing or otherwise preserving intended work:
git worktree remove ../docs-links
git worktree list

Worktrees are not sandboxes

An agent with your user permissions can access other paths. Worktrees separate edits, not security permissions. Review agent/tool access, avoid putting secrets in prompts, and follow the security policy for untrusted repositories.

Frequently asked questions

Can two agents use the same branch in different worktrees?

Git normally prevents checking out the same branch in multiple worktrees. Use a distinct branch for each independent editing task rather than overriding that protection.

Will removing a worktree delete the branch?

Removing the working directory and deleting its branch are separate operations. Preserve and integrate the change before deciding whether a branch should be deleted.

Maintained by Ubra maintainers. Product capabilities and current availability are documented in the official repository. Ubra is independent of the agent providers and tools named here.

Get notified when Ubra is available

No release downloads are published yet. Leave your email and we'll let you know when they are.