sbx: fix ordering of git sections in usage doc

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson
2026-05-12 08:51:33 +02:00
parent 98131a3be0
commit f8721005d8
+28 -28
View File
@@ -149,6 +149,34 @@ worktree. If that happens, commit from the worktree directory before pushing.
See [Workspace trust](security/workspace.md) for security considerations when
reviewing agent changes.
#### Cleanup
`sbx rm` removes the sandbox and all of its worktrees and branches.
#### Ignoring the `.sbx/` directory
Branch mode stores worktrees under `.sbx/` in your repository root. To keep
this directory out of `git status`, add it to your project's `.gitignore`:
```console
$ echo '.sbx/' >> .gitignore
```
Or, to ignore it across all repositories, add `.sbx/` to your global gitignore:
```console
$ echo '.sbx/' >> "$(git config --global core.excludesFile)"
```
> [!TIP]
> If `git config --global core.excludesFile` is empty, set one first:
> `git config --global core.excludesFile ~/.gitignore`.
You can also create Git worktrees yourself and run an agent directly in one,
but the sandbox won't have access to the `.git` directory in the parent
repository. This means the agent can't commit, push, or use Git. `--branch`
solves this by setting up the worktree so that Git works inside the sandbox.
### Signed commits
Sandboxes can sign Git commits with SSH keys from your host agent. The private
@@ -185,34 +213,6 @@ $ git commit -S
For common signing failures, see
[Sandbox commits aren't signed](troubleshooting.md#sandbox-commits-arent-signed).
#### Cleanup
`sbx rm` removes the sandbox and all of its worktrees and branches.
#### Ignoring the `.sbx/` directory
Branch mode stores worktrees under `.sbx/` in your repository root. To keep
this directory out of `git status`, add it to your project's `.gitignore`:
```console
$ echo '.sbx/' >> .gitignore
```
Or, to ignore it across all repositories, add `.sbx/` to your global gitignore:
```console
$ echo '.sbx/' >> "$(git config --global core.excludesFile)"
```
> [!TIP]
> If `git config --global core.excludesFile` is empty, set one first:
> `git config --global core.excludesFile ~/.gitignore`.
You can also create Git worktrees yourself and run an agent directly in one,
but the sandbox won't have access to the `.git` directory in the parent
repository. This means the agent can't commit, push, or use Git. `--branch`
solves this by setting up the worktree so that Git works inside the sandbox.
## Reconnecting and naming
Sandboxes persist after the agent exits. Running the same workspace path again