garden worktree
Manage additional working copies of a repository
garden worktreeAliases: wt
Create additional checkouts of one repository that share its history but keep their own working copy, so you can work on several things at once. Like git worktrees: each has its own files and current commit, and a commit made in one is reachable from the others (they share history) but does not clutter their view.
Garden has no named branches: a worktree is a path with a commit checked out. A ‘-b <name>’ is accepted as a label — you start committing and open a pull request as usual.
garden worktree add
Section titled “garden worktree add”Create a new worktree at <path>, checked out to <commit>
garden worktree add [flags] <path> [<commit>]Create a new checkout at <path> that shares this repository’s history. With no <commit> it checks out the commit you’re currently on; name any commit (including a local, un-pushed one) to start there instead.
| Flag | Type | Default | Description |
|---|---|---|---|
-b, --branch |
string | — | Label for the new line of work (garden has no branches) |
-B, --branch-reset |
string | — | Same as –branch (accepted for git parity) |
--checkout |
bool | true |
Populate the working copy (default) |
--detach |
bool | — | Check out the commit detached (the default; accepted for parity) |
-f, --force |
bool | — | Proceed even if <path> already exists (must be empty) |
--guess-remote |
bool | — | Accepted for git parity (no effect) |
--lock |
bool | — | Mark the worktree locked (guards it from remove/prune) |
--no-checkout |
bool | — | Leave the working copy empty |
--no-track |
bool | — | Accepted for git parity (no effect) |
--orphan |
string | — | Start an empty worktree with no checked-out commit |
-q, --quiet |
bool | — | Suppress informational notes |
--reason |
string | — | Reason recorded with –lock |
--track |
bool | — | Accepted for git parity (no effect) |
garden worktree list
Section titled “garden worktree list”List the repository’s worktrees
garden worktree list| Flag | Type | Default | Description |
|---|---|---|---|
--porcelain |
bool | — | Machine-readable output (path, commit, label per line) |
garden worktree prune
Section titled “garden worktree prune”Drop registry entries whose worktree is gone
garden worktree prune| Flag | Type | Default | Description |
|---|---|---|---|
-n, --dry-run |
bool | — | Show what would be pruned without changing anything |
-v, --verbose |
bool | — | Report each pruned worktree |
garden worktree remove
Section titled “garden worktree remove”Remove a worktree
garden worktree remove [-f] <path>| Flag | Type | Default | Description |
|---|---|---|---|
-f, --force |
bool | — | Remove even with uncommitted changes or a lock |