Skip to main content

Quickstart

This guide walks through initializing Graft on a running Postgres container, creating a save point, branching, and verifying integrity.

Prerequisites

  • Docker installed and running (Docker Desktop or OrbStack on macOS)
  • rsync available on your PATH
  • A running database container (e.g., Postgres, MySQL)

Initialize Graft

Graft will:
  1. Inspect the container and capture its image, environment variables, port mappings, and network settings
  2. Prompt you to select which Docker volume contains your database data
  3. Stop the container
  4. Bridge the data from the Docker volume to ~/.graft/my-postgres/branches/main/
  5. Recreate the container with a bind mount pointing at the branch directory
  6. Start the container

Capture a Save Point

Graft stops the container, hashes every file in the branch directory with BLAKE3, stores the blobs in the object pool, builds a Merkle tree, and inserts the commit into the SQLite DAG:

Create a Branch

This seeds a new branch experiment from the current branch’s tree. The container is recreated with a bind mount pointing at the new branch directory:
Make changes in your database (create tables, insert data, run migrations).

Verify Integrity

List Branches

Switch Back

Your database is back to the state captured in the initial commit, with all experiment changes isolated.