Skip to content
Docsgr worktree

Command line

gr worktree

Create, list and land git worktrees that have a graph in them

From the help of gr 0.2.16. gr help worktree prints it in full.

A git worktree with a provisioned graph: its own checkout, its own branch, its own .graphide/graph.db, and a workspace on the same the daemon process that already serves the main checkout.

gr worktree [command]

gr worktree land

Merge a worktree's branch into the base, then clean up and re-sync

Merges a worktree's branch into its base branch, pushes, removes the worktree and its branch, and brings the main checkout's graph up to date before it returns. On a conflict nothing is decided for you: the tree is left as git left it and the command to abort is printed.

gr worktree land <name> [flags]
FlagWhat it does
--base stringbranch to merge into (default: origin's default branch, else master/main)
--dry-runprint the sequence and change nothing
--keepmerge and push, but leave the worktree and its branch in place
-m, --message stringmerge commit message (default: git's own)
--no-pushmerge locally and push nothing

gr worktree ls

List this repository's worktrees, with their graph and daemon state

git's worktree list joined with the machine daemon's open workspaces.

gr worktree ls [flags]
FlagWhat it does
--jsonemit the rows as JSON

gr worktree name

Name this worktree's placeholder branch

gr worktree name <words> [flags]
FlagWhat it does
--jsonemit the result as JSON
--root stringworktree to name (default: current worktree)

gr worktree new

Create a worktree on a new branch and provision its graph

Creates <checkout>-<name> beside the main checkout, on a new branch <name>, then gives it a graph.

gr worktree new <name> [flags]
FlagWhat it does
--backgroundreturn as soon as the graph build is under way instead of waiting for it
--base stringbranch the new worktree starts from (origin's tip of it), is compared against and lands into; recorded as branch.<name>.base unless it is the default branch (default: the default branch)
--dir stringwhere to put the worktree (default: <checkout>-<name>, beside the checkout)
--forcecheck out a branch that already exists instead of refusing
--jsonemit the result as JSON

gr worktree path

Print the absolute path of a worktree, and nothing else

For cd $(gr worktree path foo) and for scripts. One line, no decoration, nothing on stdout but the path: anything else and the cd lands nowhere.

gr worktree path <name> [flags]

gr worktree rm

Close the worktree's workspace and remove its directory

Closes the worktree's workspace in the daemon, then removes its directory. Use it rather than git worktree remove, which would leave the daemon serving a graph whose files are gone.

gr worktree rm <name> [flags]
FlagWhat it does
--forceclose a live workspace and remove a dirty tree

Every command also takes --root <folder>, the project to act on. Without it, gr uses the git repository you are in, or else the current folder.

These docs describe Graphide 0.2.16, the latest release. Something wrong or missing? Tell us onDiscord or at hello@graphide.com.