Repolode
littledivy

littledivy/durable-git

A git server where each repository is a Durable Object, running on Cloudflare Workers or self-hosted on celld.

Open-source alternative to:GitHub

Stars
264
Forks
13
Open issues
0
Last commit
2 months ago

What is it?

dgit is a git server built on Cloudflare Durable Objects. Each repository is its own object with a private SQLite database that stores its objects and refs and speaks the git smart HTTP protocol, so a stock git client can clone, fetch and push against it. There is no filesystem or origin server, and repositories that nobody touches cost almost nothing. Reads are public, pushes require a token, and pushing to a new name creates the repository.

The project implements git in TypeScript, including pkt-line framing, packfile parsing with delta resolution, pack generation, and a Myers diff. When an R2 bucket is bound, pack bytes are stored in R2 while the index stays in SQLite, and full clones are cached and streamed from the Worker. Shallow clones, incremental fetches and forced updates are supported.

The built-in web interface follows the cgit layout, with a log, tree and blob views with syntax highlighting, blame, diffs, format-patch output, tar.gz and zip snapshots, and atom feeds. The package can also be used as a library to define custom authorization and push hooks.

Key features

  • 01Serves the git smart HTTP protocol so stock git clients work unchanged
  • 02Stores each repository in its own Durable Object with SQLite
  • 03Optional R2 bucket for pack storage and cached full clones
  • 04Supports shallow clones, incremental fetch and thin packs
  • 05Provides a cgit-style web interface with log, blame, diffs and snapshots
  • 06Can be used as a library with custom authorization and push hooks

Use cases

  • Hosting private git repositories on Cloudflare Workers without managing a server
  • Running a self-hosted git server on celld with replicated storage
  • Adding git hosting with custom access control to an existing application
  • Browsing repository history and downloading snapshots through a web interface

Quick start

  1. 1

    Install dependencies

    npm install
  2. 2

    Deploy the Worker to Cloudflare

    npx wrangler deploy
  3. 3

    Set the push password secret

    npx wrangler secret put GIT_TOKEN
  4. 4

    Add the deployed host as a remote and push

    git remote add origin https://<your-host>/myrepo.git

Things to know

  • Pull requests are disabled; contributions go by emailed git format-patch.
  • Very large full-history clones can exceed Cloudflare Workers CPU limits; the largest repositories are recommended on celld.
  • Deployment on Cloudflare Workers has memory and CPU request bounds.

Topics

FAQ

What is durable-git?
A git server where each repository is a Durable Object, running on Cloudflare Workers or self-hosted on celld. dgit is a git server built on Cloudflare Durable Objects. Each repository is its own object with a private SQLite database that stores its objects and refs and speaks the git smart HTTP protocol, so a stock git client can clone, fetch and push against it. There is no filesystem or origin server, and repositories that nobody touches cost almost nothing. Reads are public, pushes require a token, and pushing to a new name creates the repository.
Is durable-git free to use? What license does it have?
durable-git is open source under the MIT license. Check the license terms before using it in commercial products.
Is durable-git still maintained?
Updated within 6 months. The last commit to durable-git was on Aug 21, 2026.
What can I use durable-git for?
Hosting private git repositories on Cloudflare Workers without managing a server Running a self-hosted git server on celld with replicated storage Adding git hosting with custom access control to an existing application Browsing repository history and downloading snapshots through a web interface
How do I install durable-git?
Install dependencies: npm install Deploy the Worker to Cloudflare: npx wrangler deploy Set the push password secret: npx wrangler secret put GIT_TOKEN Add the deployed host as a remote and push: git remote add origin https://<your-host>/myrepo.git
Where can I get durable-git?
The source code and installation instructions are on GitHub: https://github.com/littledivy/durable-git

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects