跳转到内容

远端同步

Graft remote 存储 repository objects、refs、SQLite storage 和 external payloads。

支持的 URI:

memory
fs:///absolute/path
s3://bucket/prefix
s3_compatible://bucket/prefix?endpoint=https://...
https://host/org/space

本地测试:

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

S3-compatible:

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'

HTTP remote:

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

自定义 token 变量:

Terminal window
export GRAFT_ARCHIVE_TOKEN='grt_...'
graft remote add origin 'https://example.com/acme/archive?token_env=GRAFT_ARCHIVE_TOKEN'
Terminal window
graft push origin main
graft push --all origin
graft fetch origin main
graft fetch --all origin
graft pull origin main

当前分支配置 upstream 后,可以直接:

Terminal window
graft push
graft pull

非 fast-forward pull 会进入 merge state。

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

详见 Remote URI连接 HTTP 远端