Skip to content

Sync With Remotes

Graft remotes store repository objects, refs, SQLite storage, and external file payloads outside the local .graft/ directory.

Supported URI families:

memory
fs:///absolute/path
s3://bucket/prefix
s3_compatible://bucket/prefix?endpoint=https://...
https://host/org/space
graft+http://127.0.0.1:8787/org/space

Use a filesystem remote for local testing:

Terminal window
graft remote add origin fs:///tmp/graft-remote
graft remote list

Use S3-compatible storage:

Terminal window
export AWS_ACCESS_KEY_ID="..."
export AWS_SECRET_ACCESS_KEY="..."
export AWS_REGION="auto"
graft remote add origin 's3_compatible://my-bucket/prod/app?endpoint=https://account.r2.cloudflarestorage.com'

Use a Graft HTTP remote:

Terminal window
export GRAFT_REMOTE_TOKEN='grt_...'
graft remote add origin 'https://example.com/acme/archive'

For a non-default token variable:

Terminal window
export GRAFT_ARCHIVE_TOKEN='grt_...'
graft remote add origin 'https://example.com/acme/archive?token_env=GRAFT_ARCHIVE_TOKEN'

Push the current branch:

Terminal window
graft push origin main

Push the current branch to its configured upstream:

Terminal window
graft push

Push every local branch:

Terminal window
graft push --all origin

Force push is available for deliberate non-fast-forward updates:

Terminal window
graft push --force origin main

Use it with the same care you would use git push --force.

Fetch updates remote-tracking refs without changing your current branch:

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

Pull fast-forwards or enters merge state:

Terminal window
graft pull origin main

If the branch has an upstream, you can omit the remote and branch:

Terminal window
graft pull

Clone a remote repository into an empty worktree:

Terminal window
mkdir app-clone
cd app-clone
graft clone fs:///tmp/graft-remote main

Clone picks the requested branch, materializes tracked database snapshots and files, and configures origin.

Terminal window
graft remote list
graft remote get-url origin
graft remote set-url origin fs:///srv/graft/new-app
graft remote rename origin archive
graft remote remove archive
graft remote prune origin
graft ls-remote origin

See Remote URIs for exact URI parsing rules and Connect An HTTP Remote for the HTTP client workflow.