Remote URI
添加或修改 remote:
graft remote add origin <uri>graft remote set-url origin <uri>URI Shapes
Section titled “URI Shapes”| URI | 用途 |
|---|---|
memory | 测试和临时 remote。 |
fs:///absolute/path | 本地或挂载文件系统。 |
s3://bucket/prefix | AWS S3-style object storage。 |
s3_compatible://bucket/prefix | R2、MinIO 等 S3-compatible storage。 |
s3_compatible://bucket/prefix?endpoint=https://... | 带自定义 endpoint 的 S3-compatible storage。 |
https://host/org/space | 规范的 Git 风格 Graft remote service URL。 |
graft+https://host/org/space | 显式 Graft-over-HTTPS 兼容形式。 |
graft+http://127.0.0.1:8787/org/space | 本地 HTTP remote 开发。 |
S3-Compatible
Section titled “S3-Compatible”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'credential 不写入 .graft/config.toml,也不放在 URI 中。使用环境变量或标准
AWS config files。
当前 URI query 只接受 endpoint。
HTTP Protocol
Section titled “HTTP Protocol”export GRAFT_REMOTE_TOKEN='grt_...'graft remote add origin 'https://example.com/acme/archive'graft+https://example.com/acme/archive 仍作为兼容 alias 接受,两种形式使用同一
remote service protocol。
自定义 token 环境变量:
export GRAFT_ARCHIVE_TOKEN='grt_...'graft remote add origin 'https://example.com/acme/archive?token_env=GRAFT_ARCHIVE_TOKEN'HTTP remote 以 bearer token 发送访问密钥。wire contract 见 Remote Service 协议。