Skip to content

Branches ​

In standard Git, all open terminals and editor windows share a single .git/HEAD. Running git checkout feat/pricing in one terminal switches the branch underneath every other open terminal and AI agent.

Tessera separates per-terminal branches, per-agent branches, and your editor branch so they never step on each other.

Editor, Terminal & Agent Branches in One Folder
Editor Branch
.git/HEAD → main
VS Code · ~/acme-websrc/App.vueWorking tree: main⎇ main ◎ Graph
Editor on main
Terminal Tabs
Term 1 · (tes:feat/pricing)❯ npm run dev → :4100Term 2 · (tes:feat/faq)❯ npm test → ✓ Pass
✓ Independent Tabs
Agent Branches
tes claim --branch
Agent 1 · feat/pricingIsolated in .git/tesseraAgent 2 · feat/faqIsolated in .git/tessera
✓ HEAD Untouched
Switch or Merge
Anytime
--editor / merge~/acme-webtes switch feat/pricing --editortes merge ... --into main
✓ Preview or Merge
Editor on main·Per-terminal tes switch·Per-agent branch claims·Switch editor or merge

Switching Branches ​

When shell integration is enabled (tes env --install), each terminal tab has its own session and can switch branches independently:

bash
# Terminal 1
tes switch feat/pricing

# Terminal 2
tes switch feat/faq

If the target branch does not exist yet, Tessera creates it automatically from HEAD.

In a switched terminal tab:

  • Your shell prompt displays (tes:feat/pricing) so you always see which branch that tab is on.
  • Commands you run in that terminal (npm test, npm run build, npm run dev, cargo test) execute inside that branch's Copy-on-Write sandbox while your terminal prompt stays in your project folder.
  • Other open terminals and your code editor remain untouched.

Switching the Editor Branch ​

When you want your IDE file explorer and language server to display a different branch's files in your main repository folder, switch the editor branch:

  • In VS Code / Antigravity IDE: Click the branch name in the bottom-left status bar and select the branch from the dropdown.
  • From the CLI: Pass --editor (or -e) to tes switch:
bash
tes switch feat/pricing --editor

Switching the editor branch updates your repository working tree and .git/HEAD while keeping any open terminal tabs pinned to their own branches.

Assigning an Agent to a Branch ​

To have an AI agent build a feature on a specific branch without switching your editor away from main, name the branch in your prompt:

"On branch feat/faq, create src/components/TestimonialsFaq.vue and add it to src/App.vue."

The agent claims the branch automatically:

bash
tes claim --branch feat/faq --intent "Add Testimonials and FAQ section" src/components/TestimonialsFaq.vue src/App.vue

When the agent finishes and commits onto feat/faq, your main working tree remains clean.

Listing Branches ​

View all branches in the repository and see which branch your current terminal session is using:

bash
tes branch

Pass --json to inspect commit hashes, assigned ports, active sessions, and modified files ahead of main:

bash
tes branch --json

Merging Branches ​

Combine one or more feature branches into main (or any target branch) using tes merge --into:

bash
# Merge a single branch into main
tes merge feat/pricing --into main -m "feat: add pricing calculator"

# Merge multiple branches into main at once
tes merge feat/pricing feat/faq --into main -m "feat: add pricing and faq"

During tes merge, Tessera merges unchanged directories without reading file blobs, detects renamed files across directories, renumbers colliding sequential SQL migrations, merges package.json, Cargo.toml, and Cargo.lock dependencies structurally, and combines concurrent AST changes with Tree-sitter.

Pushing to Remotes ​

Commit any pending session changes and push a branch to your Git remote (origin):

bash
tes push
tes push -u origin feat/pricing

See Also ​

  • Sandboxes - Running builds and dev servers across branches
  • Conflicts - Handling conflicts and rolling back merges
  • Editor Support - Switching and merging branches in VS Code