Skip to content

Quickstart

Turn a directory of related repos into one workspace, then commit and publish across all of them at once. The Rust CLI now ships the v0 loop: construct a workspace, land a cross-repo change, push in dependency-safe order, clone it on a fresh machine, and review the combined artifact.

Install

sh
curl -fsSL https://raw.githubusercontent.com/mostlydev/gnit/master/install.sh | sh

This downloads the latest release for your platform, verifies its SHA-256 checksum, and installs gnit to ~/.local/bin (override with GNIT_INSTALL_DIR). It also cleans up a pre-rename nit install when it can verify it is this tool's; unrelated tools named nit are never touched. It needs git and curl. Verify the install with gnit doctor, and update later with gnit update.

Create A Workspace

sh
mkdir product && cd product
gnit init --control --remote git@github.com:example/product-workspace.git

git clone git@github.com:example/app.git app
git clone git@github.com:example/sdk.git sdk
git clone git@github.com:example/docs.git docs

gnit adopt app sdk docs
gnit pin baseline
gnit push

gnit init also drops a short Gnit workspace note into AGENTS.md (and CLAUDE.md if you keep one) so coding agents reach for the gnit CLI and skill instead of hand-managing the member repos. gnit doctor re-adds it if it ever goes missing.

Publish A Cross-Repo Change

sh
gnit add -A
gnit land -m "Publish webhook retry update"
gnit push
gnit pr open

gnit land is the human-facing publish verb. It commits staged member changes, creates an unnamed Pin, and lets gnit push publish member commits before the Pin. If one member push fails, Gnit reports what landed, leaves later targets not-attempted, and holds the workspace root back. After resolving the member repo, run gnit push again, or use gnit push --resume as an explicit retry.

gnit pr open creates or adopts the ordinary GitHub PRs for the current Change and writes Gnit-owned cross-links into each PR body. It opens draft PRs by default. gnit pr is the read-only status command to check what exists, what is missing, and which checks are passing:

text
$ gnit pr
Workspace change GCH-1780970169140-18d6
repo                         branch              base        pr        state     checks
root (metadata)              feature/pr-flow     master      #1        open      pending
sdk                          feature/pr-flow     master      #2        open      pass
app                          feature/pr-flow     master      missing   -         -

$ gnit pr open
Opening PRs for Change GCH-1780970169140-18d6
Title: Add linked PR flow
Mode: draft
  root                     already open
  sdk                      already open
  app                      created
PRs synchronized.

Re-running gnit pr open is safe: it refreshes already-open PRs instead of duplicating them, so it doubles as the recovery command after a network blip.

sh
gnit review <change-id-or-pin>

gnit review is local-only. If a pinned member commit is not available in the current clone, it names the member and prints the gnit checkout or git fetch command that will hydrate it.

Reconstruct A Workspace

sh
gnit clone git@github.com:example/product-workspace.git product --pin baseline

gnit clone clones the control repo and hydrates member repos from the roster. With --pin, it also materializes the selected Pin.

Pinned checkout is intentionally exact, but it stays branch-aware. If the pinned commit is a local or remote branch tip, Gnit checks out that branch instead of leaving you on a detached HEAD. It refuses to overwrite dirty member worktrees unless you use gnit checkout <pin> --exact.

Gnit is an early design for Git-native multi-repo workspaces.