A JavaScript reimplementation of git that runs in Node.js and in the browser without native C++ dependencies. It reads and writes repositories, and can fetch from and push to remotes.
Overview
isomorphic-git implements git operations in pure JavaScript so the same library can run on servers and in browser JavaScript, including WebWorkers and ServiceWorkers. It modifies the standard .git directory on disk the same way canonical git does, aiming for interoperability with ordinary git workflows.
The API exposes individual functions so bundlers can include only what an app needs. You supply your own file system and HTTP client in the browser; in Node you can use the native fs module and the provided HTTP helpers. Type definitions support static checking in common editors.
Supported workflows include cloning, init, branches, tags, commit history, checkout, push, commit, config, raw objects, PGP signing, status, and merge, among many other git commands. A separate isogit CLI maps command-line usage to the JavaScript API for quick testing, though it is not intended as a full git CLI replacement.
Browser use often needs a CORS proxy for clone and push against major hosts; complementary packages exist for that purpose. LightningFS and similar libraries emulate a file API when git runs client-side.
Key features
- Clone and push without native modules
- Same code in Node and browser
- Pluggable file system and HTTP
- Tree-shakeable function API
- On-disk .git compatibility goal
- Broad git command coverage
- Optional isogit CLI
- TypeScript type definitions
Use cases
- Git in browser-based editors
- Server-side git automation in Node
- Embedded git in web apps
- Small bundles via selective imports
- Teaching or prototyping git clients