GET: repo-to-worktree verb (checkout, clone, switch, restore)

gritzko

GET exports git trees from repo into the worktree: clone, switch branch, detach, or restore in git's terms. It never changes history — it only resets the worktree to a chosen version, maybe re-applying uncommitted changes. The exact action is defined by the shape of the URI:

  1. Path: (unless Host is set) scopes to file/subtree/submod,
  2. Fragment: a sha pin, in case we want to specify the exact commit.
  3. Query: the branch/tag/hash to switch to,
  4. Host: remote to fetch from (uses the cached tip if no scheme set),
  5. Scheme: the protocol (ssh: be: file:) to use.

CLI use

    be get...
    ?feat                — switch wt+cur to branch feat
    ?./fix               — enter a child branch (?../sib a sibling)
    ?                    — switch to the trunk
    ?abc1234             — detached checkout at a sha
    #~1                  — rewind cur one commit, reset the wt
    file.c               — restore one file from cur's baseline
    file.c?feat          — get file.c from feat's tip
    //origin?feat        — reset from the cached tip (no network)
    ssh://host?feat      — fetch, then checkout
    ssh://host/repo.git  — clone: fetch + checkout (recurses subs)
    file:../proj?feat    — wire an empty cwd as a sibling worktree
                         — (empty) bare: FF the wt to cur's branch tip

RefLog/WTLog interaction

  1. Reference Log: resolves the ?ref to a tip sha,
  2. Worktree Log: writes a get row (the new base branch + tip hash),

Forceful execution

be get! resets the worktree to a clean state, all local changes discarded.