Hosted repos (v0)¶
Hosted repos are the first shape iroh-forge shipped: git's own pack protocol tunnelled over iroh to one server with a stable key (Option A). They still work, but the repo lives only as long as that server. For repos that outlive any machine, use content-addressed repos.
Clone, push, hand off¶
iroh-forge id # your client id; send it to the owner
git clone iroh://<server-id>/<repo>
git push # needs write access
iroh-forge grant iroh://<server-id> <peer-id> # writers can hand access on
Pushing to a repo name that doesn't exist yet creates it:
git remote add forge iroh://<server-id>/myproject
git push forge main
Run a server¶
iroh-forge serve ~/forge # serves ~/forge/<name>.git
iroh-forge allow <client-id> # read + write
iroh-forge allow <client-id> --read-only
iroh-forge revoke <client-id>
iroh-forge public-read true # anyone with the id can clone
The server id is an iroh endpoint id. Keys live in ~/.iroh-forge, so it
survives restarts, and the access list is re-read on every connection.
Agent hand-off¶
- Agent B runs
iroh-forge idand sends the id to agent A. - Agent A runs
iroh-forge grant iroh://<server-id> <B's id>. - Agent A sends B the URL
iroh://<server-id>/<repo>. B clones and pushes.
How it works¶
git-remote-iroh implements git's connect remote-helper capability. Each
git operation opens one QUIC stream on ALPN iroh-forge/git/0, sends a header
line (git-upload-pack <repo> <GIT_PROTOCOL>), and after the server answers
ok the stream carries git's pack protocol to git upload-pack /
git receive-pack on the server.
Hosting
The server must be awake to answer. A host that suspends idle machines makes clones time out until something wakes it, so run it somewhere always on.