Skip to main content

Installation

Requirements

  • Go 1.21+ (for go install)
  • Docker — Docker Desktop or OrbStack on macOS, Docker Engine on Linux
  • rsync — Must be available on your PATH

Check Dependencies

# Verify Docker
docker ps

# Verify rsync
rsync --version

Install via Go

go install github.com/tomiwa-amole/graft/cmd/graft@latest
This places the graft binary in $GOPATH/bin (default: ~/go/bin/graft). Ensure $GOPATH/bin is on your PATH.

Build from Source

git clone https://github.com/tomiwa-amole/graft.git
cd graft
go build -o graft ./cmd/graft

Verify Installation

graft --help
You should see:
Graft is a CLI tool that provides instant, local database branching
by manipulating Docker volumes at the file-system level.

Usage:
  graft [command]

Available Commands:
  checkout    Switch to a specific data branch
  commit      Create a save-point for the current active branch
  delete      Delete a specific data branch
  init        Initialize graft on a target container
  list        List all local data branches
  reset       Reset the current branch to main's current save-point
  rollback    Revert the current branch to a specific save-point
  verify      Verify integrity of a branch against its saved Merkle tree root

Environment Variables

VariableDefaultDescription
GRAFT_HOME~/.graftRoot directory for Graft project data
GRAFT_RSYNCrsyncPath to the rsync binary

Notes for macOS

Docker Desktop (4.22+) and OrbStack both support bind mounts via virtio-fs, a high-performance filesystem sharing protocol. Graft’s bind mount mode works on both. On older Docker Desktop versions (before 4.22), bind mount performance may be noticeably slower due to the legacy osxfs filesystem sharing.