Skip to content

Branches And Remotes

Graft follows Git’s branch and remote shape closely enough that common workflows should feel familiar.

A branch is a named ref under .graft/refs/heads/:

Terminal window
graft branch feature/search
graft switch feature/search
graft switch -c experiment main

Switching branches materializes tracked database snapshots and file artifacts from the target commit into the worktree.

Fetching from a remote updates refs under:

refs/remotes/<remote>/<branch>

Fetch does not change the current branch:

Terminal window
graft fetch origin main
graft fetch --all origin

Pull combines fetch with either fast-forward or merge:

Terminal window
graft pull origin main

If the current branch has an upstream, graft pull can infer the remote and branch. A non-fast-forward pull enters merge state and records conflict stages in the index.

Push uploads repository objects, SQLite storage, external payloads, and refs:

Terminal window
graft push origin main
graft push --all origin

--force allows deliberate non-fast-forward ref updates.

Clone initializes a new worktree from a remote branch:

Terminal window
graft clone fs:///srv/graft/app main

It configures origin, fetches history, sets upstream tracking, and materializes the selected branch.

Graft remotes can use a filesystem path, S3-compatible object storage, or the Graft HTTP protocol:

fs:///srv/graft/app
s3_compatible://bucket/prefix?endpoint=https://...
https://host/org/space

See Sync With Remotes for workflows and Remote URIs for URI syntax.