Skip to content

Commit b7b1ad5

Browse files
committed
[Artifacts] clarify Git protocol docs
1 parent e3df874 commit b7b1ad5

1 file changed

Lines changed: 19 additions & 6 deletions

File tree

src/content/docs/artifacts/api/git-protocol.mdx

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ sidebar:
66
order: 3
77
---
88

9-
Artifacts exposes a standard git smart HTTP remote at `https://{accountId}.artifacts.cloudflare.dev/git/{namespace}/{repo}.git`.
9+
Artifacts exposes Git access for every Artifacts repository.
1010

11-
Use the returned repo `remote` with a regular git client for `clone`, `fetch`, `pull`, and `push`.
11+
Each repo has a standard Git smart HTTP remote at `https://{accountId}.artifacts.cloudflare.dev/git/{namespace}/{repo}.git`.
1212

13-
## Authentication methods
13+
Use the returned repo `remote` with a regular Git client for `clone`, `fetch`, `pull`, and `push`.
14+
15+
## Authentication
1416

1517
Git routes accept repo access tokens in two forms:
1618

@@ -23,7 +25,7 @@ Git routes accept repo access tokens in two forms:
2325

2426
Repo tokens are issued in the control-plane response format `art_v1_<40 hex>?expires=<unix_seconds>`.
2527

26-
## HTTPS remote (recommended)
28+
### HTTPS remote (recommended)
2729

2830
For the URL form, use the token secret in the password slot. Artifacts ignores the Basic auth username.
2931

@@ -41,9 +43,9 @@ git remote add origin "$ARTIFACTS_AUTH_REMOTE"
4143
git push -u origin main
4244
```
4345

44-
Use any non-empty username in the URL. Artifacts currently accepts that username but does not otherwise use or log it, so `x` is just a placeholder.
46+
Use any non-empty username in the URL. Artifacts accepts that username but does not otherwise use or log it, so `x` is just a placeholder.
4547

46-
## Git `extraHeader` parameter
48+
### Git `extraHeader` parameter
4749

4850
Git's [`http.extraHeader`](https://git-scm.com/docs/git-config#Documentation/git-config.txt-httpextraHeader) setting lets you attach an HTTP header to git requests.
4951

@@ -53,6 +55,17 @@ If you want to use the full token string returned by the API, pass it as a Beare
5355
git -c http.extraHeader="Authorization: Bearer $ARTIFACTS_TOKEN" clone "$ARTIFACTS_REMOTE" artifacts-clone
5456
```
5557

58+
## Protocol support
59+
60+
Artifacts supports Git protocol v1 and v2 for clone and fetch. Git clients negotiate the protocol automatically.
61+
62+
| Operation | Git service | Protocol support | Notes |
63+
| --------------------------------- | ------------------ | ---------------- | -------------------------------------------------------------------------------------------------------------------------- |
64+
| Clone and fetch | `git-upload-pack` | v1 and v2 | Protocol v2 supports `ls-refs` and `fetch`. Protocol v1 supports normal fetch flows, including shallow and deepen fetches. |
65+
| Push | `git-receive-pack` | v1 | Push uses the standard v1 receive-pack flow. |
66+
| Push over protocol v2 | `git-receive-pack` | Not supported | Artifacts does not support v2 receive-pack. |
67+
| Optional protocol v1 capabilities | `git-upload-pack` | Partial | Some optional v1 capabilities, such as `filter` and `include-tag`, are not supported. |
68+
5669
## Token scopes
5770

5871
| Scope | Commands | Notes |

0 commit comments

Comments
 (0)