This worker speaks git's "smart" protocol. It works reasonably well for small repos. This isn't meant to serve as a "real" git server, but instead to see what's possible with R2.
Clone this worker:
git clone https://git.codygriffin.com/cfgit.git
Configure - In the wrangler.toml - edit your AUTH_USER and BUCKET.
Set a secret
npx wrangler secret put AUTH_SECRET
# enter secret when prompted
Publish
npx wrangler publish
Bootstrap - Add as an origin, and push. New repos are created automatically.
# Change the origin to your new worker
git remote set-url origin https://${your-worker}.workers.dev/cfgit.git
git push -u origin master
Miniflare - Run locally for development
# Create dev credentials cat <<EOF > .env AUTH_USER=dev AUTH_SECRET=dev EOF npm install npm run dev git add remote dev http://localhost:8787/cfgit.git git push -u dev master # Clean out persistent R2 data rm -rf .mf/r2/BUCKET/repos/${repo}