mirror of
https://github.com/docker/docs.git
synced 2026-06-19 07:35:16 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user