GitRest provides a REST API to Git repositories, modeled after GitHub's REST APIs. It is part of the Fluid Framework server infrastructure.
- Release group root:
server/gitrest/ - Packages:
@fluidframework/gitrest(packages/gitrest/) — Entry point of the GitRest service (src/www.ts)@fluidframework/gitrest-base(packages/gitrest-base/) — Base library: routes, utils, runners, storage, and Redis integration
- Workspace: pnpm workspaces (
pnpm-workspace.yaml)
src/routes/git/— Git object REST endpoints: blobs, commits, refs, tags, treessrc/routes/repository/— Repository-level endpoints: commits, contentssrc/routes/summaries.ts— Summary upload/downloadsrc/utils/— Core utilities: filesystem abstractions, isomorphic-git manager, Redis FS, whole-summary read/writesrc/runner.ts/src/runnerFactory.ts— Service runnersrc/app.ts— Express app setupsrc/test/— Mocha tests
# Install dependencies
pnpm install
# Build all packages
pnpm run build
# Build without linting (faster)
pnpm run build:compile
# Lint
pnpm run lint
pnpm run lint:fix
# Run tests (gitrest-base only)
cd packages/gitrest-base && npm test
# Test with coverage
cd packages/gitrest-base && npm run test:coverage
# Start the service
npm run start# Build container (run from server/gitrest/)
docker build -t gitrest . --build-context root=../..
# Dev mode with docker-compose
npm run start:dev
# Run tests in container
docker run -t gitrest npm test- Runtime: Node.js, Express
- Git backend: isomorphic-git
- Storage: Local filesystem, Redis (via
redisFs), in-memory (memfs) - Testing: Mocha, Sinon, Supertest, c8 (coverage)
- Linting: ESLint + Prettier
- Build: TypeScript, concurrently
Endpoints follow the GitHub API pattern:
POST /repos/:owner/:repo/git/blobs— Create blobPOST /repos/:owner/:repo/git/trees— Create treePOST /repos/:owner/:repo/git/commits— Create commitPOST /repos/:owner/:repo/git/refs— Create refPATCH /repos/:owner/:repo/git/refs/:ref— Update refDELETE /repos/:owner/:repo/git/refs/:ref— Delete refPOST /repos/:owner/:repo/git/tags— Create tag
- Follow the parent repo's CLAUDE.md: use string literal assert messages (not hex codes) for new asserts.
- API report files (
*.api.md) are generated — never hand-edit them. - TypeScript strict mode. ESLint config extends
@fluidframework/eslint-config-fluid. - Prettier config is at the release group root (
prettier.config.cjs).