Skip to content

Review and land

Bring a box's commits into your checkout with abx diff and abx land, and choose a landing mode.

Updated

A box started from a Git checkout works on its own branch. Its commits reach your checkout only through abx diff and abx land. This page covers that round trip and the three landing modes. Scratch boxes have no branch, so diff and land don’t apply to them (see Workspaces).

The round trip

A Git box starts from your current commit, on the guest branch agent/<box>. The guest user is agent and the work is in /work.

  1. Work in the box and commit there. Uncommitted guest changes are not landed.

    abx shell fix-auth -- git branch --show-current
    abx shell fix-auth

    The first command creates the box if needed and prints agent/fix-auth. The second opens an interactive shell. Press Ctrl-\ to detach. Running the same command reattaches.

  2. Review the commits from the checkout on the host.

    abx diff fix-auth

    The patch goes to stdout and a review summary to stderr. abx diff --stat prints a diffstat instead, and abx diff --stat --json prints it as JSON.

  3. Land them.

    abx land fix-auth
  4. Exit the shell or agent in the box, then stop the box, or remove it.

    abx stop fix-auth

    abx stop refuses with box-busy while a session is still running, even a detached one. --force stops it anyway.

Without a box name, diff and land use the only box in the current workspace. With several boxes they fail with ambiguous-box and list the names; with none they fail with no-box. Neither command creates a box.

What land applies

abx diff imports the guest’s commits into a staging repository that only the host writes, then prints what will enter your branch. abx land applies exactly what the last diff of that box showed. If the guest branch or your branch has changed since that diff, land refuses with review-stale and tells you to run abx diff again. If you pass a different landing mode than the diff used, it refuses with landing-mode-mismatch. Let diff finish before you land.

abx never runs Git commands against files the guest can write. The guest’s work arrives as a bundle and is checked as a tree before it is shown.

land also refuses when the destination has tracked or staged changes (dirty-worktree), or when the change overlaps worktree paths that already exist (worktree-conflict). It refuses changes to execution-sensitive paths (executable-paths-unconfirmed) unless you pass --allow-executable.

Repeating a landing reports already-landed while the guest tip, checkout, mode and applied result still match. Run diff again to target a different checkout or branch. land --json prints the result as JSON on stdout.

Landing modes

Without a flag the mode is fast-forward. Review and land must use the same mode.

Three Git graphs. Fast-forward: your branch moves along the guest branch to its tip. Merge: a merge commit joins your branch and the guest branch agent/box-name. Squash: the final tree is staged in your checkout as an uncommitted change for you to commit.

Mode Review with Land with Result
Fast-forward (default) abx diff abx land Your branch moves to the guest’s tip.
Merge abx diff --merge abx land --merge A merge commit joins divergent history.
Squash abx diff --squash abx land --squash The final tree is staged in your checkout and you commit it yourself.

Use --merge when your branch and the guest branch have diverged.

abx diff fix-auth --squash
abx land fix-auth --squash
git commit

Choosing a checkout

abx finds the repository from the current directory. Use the global -C DIR option to act from another one:

abx -C ~/src/app diff fix-auth

Type to search…

↑↓ navigate↵ selectEsc close