Home > Engineering > Infrastructure > bare-for-pear > isomorphic-git

isomorphic-git — Dual-Backend Git

Full isomorphic-git (pure JavaScript git implementation) with a Hyperdrive fs adapter for P2P storage. Unmodified upstream — the fork adds the adapter and Bare runtime documentation.

Source: bare-for-pear/isomorphic-git


What It Does

Standard git operations — porcelain (add, commit, checkout, status, log, diff, merge, push, pull) and plumbing (readBlob, writeTree, writeCommit, etc.) — on two storage backends, selected by plugging in the appropriate fs implementation:

isomorphic-git takes an fs parameter on every call. The adapter maps 10 fs methods (readFile, writeFile, stat, lstat, readdir, mkdir, rmdir, unlink, readlink, symlink) to Hyperdrive v11 operations.

The Hyperdrive Adapter

The key mapping decisions:

Running Under Bare

One configuration requirement: import the ESM build (index.js), not the CJS build. Bare resolves the "node" export condition by default, which points to CJS — and the CJS build hard-requires Node’s crypto. The ESM build falls back to pure-JS sha.js. All other dependencies are pure JS.

Current State

Proven via POC probe. Porcelain and plumbing operations produce identical commit hashes on both backends. A full round-trip (bare-fs → Hyperdrive → bare-fs) with 14 git objects returns identical content. Not yet exercised: merge, large repos, concurrent access, symlink round-trip.