Document Git protocol v2 support · Entire
Document Git protocol v2 support
74373e4→main·
Soph·3mo ago·1 file·+16 added/-1 removed
Sessions
6705fddb3ef7View transcript
[?
Can you take a look at the go code (wasm) in /Users/soph/Work/entire/devenv/entire-io-worktree1 based a bit on that I wonder if something like this can be build:Codex·GPT-5.4·1 step](/content/gh/entireio/git-sync/session/019d6d29-8cf7-7fe3-adc9-8c3e4d9d5603#timeline-6705fddb3ef7/index.html)
Changes
1
- MREADME.md+16/-1
18 unmodified lines
19
20
21
22
23
24
25
25
26
27
28
29
30
31
32
38 unmodified lines
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
17 unmodified lines
103
104
105
106
107
108
109
110
111
112
18 unmodified lines
- Optional forced retargeting with `--force`
- Optional managed-ref deletion with `--prune`
- Optional transfer stats output with `--stats`
- Optional source-side Git protocol v2 for `ls-refs` and `fetch`
## Limits
- Protocol v2 is not implemented yet. `--protocol auto` currently resolves to v1.
- Push still uses the existing v1-style `receive-pack` path.
- Protocol v2 support currently covers source discovery and source fetch only.
- `--protocol auto` tries source-side v2 first and falls back to v1.
- `--protocol v2` requires the source remote to negotiate v2.
- Ref mapping is explicit, not wildcard-based.
- Only smart HTTP remotes are supported.
- Objects are kept in memory for the duration of the run.
38 unmodified lines
<target-url>
```
Force source-side protocol v2:
```bash
go run ./cmd/git-sync sync \
--protocol v2 \
<source-url> \
<target-url>
```
Dry run:
```bash
17 unmodified lines
## Behavior
- Source refs are listed with `GET /info/refs?service=git-upload-pack`.
- When the source supports it, the client can negotiate protocol v2 with `Git-Protocol: version=2`, then use `ls-refs` and `fetch`.
- Target refs are listed with `GET /info/refs?service=git-receive-pack`.
- The source fetch advertises current target tip hashes as `have`, so reruns download less when source and target already share history.
- Target push stays on the current `receive-pack` path.
- If a target ref does not exist, it is created.
- If a target ref already matches the source, it is skipped.
- Branches are updated only when the target tip is an ancestor of the source tip, unless `--force` is set.