isomorphic-git is a free, open source browsers & extensions project written in JavaScript and released under MIT. It has 8,354 GitHub stars, 491 forks and 306 open issues, and was last pushed 7 days ago. On this registry it ranks #44 of 101 tracked projects in Browsers & Extensions, with 5 head-to-head comparisons available.
What is isomorphic-git?
isomorphic-git is a pure JavaScript reimplementation of git that runs in both Node.js and browser JavaScript environments, aimed at developers who need to read and write git repositories, fetch from and push to remotes such as GitHub, and do all of it without any native C++ module dependencies.
What it is
isomorphic-git is a pure JavaScript reimplementation of git that works in both Node.js and browser JavaScript environments. It reads and writes git repositories and fetches from and pushes to git remotes such as GitHub, all without native C++ module dependencies. Every operation modifies files in a .git directory exactly the way canonical git does, because the project targets 100% interoperability with the canonical implementation. The package also ships an isogit CLI that can operate on repositories on a desktop or a server.
The problem it solves is that canonical git is a C++ program that assumes a filesystem and an operating system process. Browsers have no fs module, and Node.js and browsers expose different APIs for making HTTP requests, so the usual approach of linking against native git bindings simply cannot run in a browser. Instead of relying on the fs and http modules, isomorphic-git lets the caller bring a filesystem and an HTTP client. The library lives in the npm and Node.js ecosystem, is designed for bundlers such as Rollup and Webpack, and it replaces native C++ module dependencies and the canonical git binary for use cases where neither can be embedded.
Key capabilities
Pure JavaScript implementation with no native C++ module dependencies, running in both Node.js and browser environments.
Full read and write access to git repositories through direct modification of files in the .git directory, matching canonical git behavior.
Network operations against git remotes such as GitHub for fetch and push.
Bring-your-own filesystem and HTTP client, with isomorphic-git/http/node for Node.js and isomorphic-git/http/web for browsers.
Bundler-friendly API exposed as individual functions, so Rollup and Webpack can include only the functions an application uses and produce smaller bundles.
Bundled type definitions that provide static type-checking and completion in editors such as VS Code and CodeSandbox.
Shipped isogit command-line interface for operating on repositories on a desktop or server.
Who uses it and how
Node.js applications that pass the native fs module together with isomorphic-git/http/node to clone, fetch, and push repositories programmatically.
Browser applications that supply a filesystem emulator, most commonly LightningFS, which is written and maintained by the same author and is part of the isomorphic-git suite.
Teams that prefer a different filesystem layer, since the library also works with ZenFS and Filer.
Editor and online sandbox integrations, where the included type definitions drive completion in VS Code and CodeSandbox.
Deployments validated in continuous integration across Node 10, Chrome 79, Edge 79, Firefox 72, Safari 13, Android 10, and iOS 13, all supported until the next breaking version.
Getting started
Install from npm with npm install --save isomorphic-git. In Node.js, pass the native fs module and isomorphic-git/http/node to calls such as git.clone; in the browser, use LightningFS together with isomorphic-git/http/web.
How it compares
No paid products that this project replaces are listed in the registry data, and the facts name no other git implementation to compare against, so isomorphic-git stands alone in this registry. LightningFS, ZenFS, and Filer are named only as interchangeable filesystem options under the same library rather than as competing products.
When to use it — and when not to
A project adopting isomorphic-git must supply its own filesystem and HTTP client, and anyone using LightningFS in a browser should note that it may apply file operations out of order, which can corrupt a repository if the process crashes; calling fs.flush() after git operations mitigates this. Maintenance is community-driven: the original author left the project, and two volunteers handle code review and issues without writing much code, so a team that needs a specific feature should expect to implement it or fund someone to do so. With 306 open issues and a maintenance model that favors stability over new development, this is a poor fit for teams that require vendor-backed support or a guarantee of prompt upstream changes.
project readme (upstream, from github) — read inline
isomorphic-git
isomorphic-git is a pure JavaScript reimplementation of git that works in both Node.js and browser JavaScript environments. It can read and write to git repositories, fetch from and push to git remotes (such as GitHub), all without any native C++ module dependencies.
Goals
Isomorphic-git aims for 100% interoperability with the canonical git implementation. This means it does all its operations by modifying files in a ".git" directory just like the git you are used to. The included isogit CLI can operate on git repositories on your desktop or server.
This library aims to be a complete solution with no assembly required.
The API has been designed with modern tools like Rollup and Webpack in mind.
By providing functionality as individual functions, code bundlers can produce smaller bundles by including only the functions your application uses.
The project includes type definitions so you can enjoy static type-checking and intelligent code completion in editors like VS Code and CodeSandbox.
Project status
The original author of the project (Billie Hilton) left the project, but the project is still maintained by two volunteers:
But they don't write much code, mainly do code review and try to answer to issues and on Gitter, they just don't want the project to die. So you can say that this project is community driven (as jcubic always reply to issues). Which means that if you want a feature to be implemented you need to do this yourself or find someone that is willing to write the code for you. The project have some money on OpenCollective and we can spend it on some development, if you find someone that is willing to code in exchange to some bucks (it may be you), but we don't have a lot so don't expect to have full sallary.
If you want to help this project you're more than welcome to do so.
Supported Environments
The following environments are tested in CI and will continue to be supported until the next breaking version:
The "isomorphic" in isomorphic-git means that the same code runs in either the server or the browser.
That's tricky to do since git uses the file system and makes HTTP requests. Browsers don't have an fs module.
And node and browsers have different APIs for making HTTP requests!
So rather than relying on the fs and http modules, isomorphic-git lets you bring your own file system
and HTTP client.
If you're using isomorphic-git in node, you use the native fs module and the provided node HTTP client.
If you're using isomorphic-git in the browser, you'll need something that emulates the fs API.
The easiest to setup and most performant library is LightningFS which is written and maintained by the same author and is part of the isomorphic-git suite.
⚠️ LightningFS may apply file operations out of order, which can lead to repository corruption if the process crashes. You can mitigate this by calling fs.flush() after Git operations.
If LightningFS doesn't meet your requirements, isomorphic-git should also work with ZenFS and Filer.
Instead of isomorphic-git/http/node this time import isomorphic-git/http/web:
<script src="https://unpkg.com/@isomorphic-git/lightning-fs"></script>
<script src="https://unpkg.com/isomorphic-git"></script>
<script type="module">
import http from 'https://unpkg.com/isomorphic-git@beta/http/web/index.js'
const fs = new LightningFS('fs')
const dir = '/test-clone'
git.clone({ fs, http, dir, url: 'https://github.com/isomorphic-git/lightning-fs', corsProxy: 'https://cors.isomorphic-git.org' }).then(console.log)
</script>
If you're using ES module syntax, you can use either the default import for convenience, or named imports to benefit from tree-shaking if you are using a bundler:
import git from 'isomorphic-git'
// or
import * as git from 'isomorphic-git'
// or
import {add, clone, commit, push} from 'isomorphic-git'
Then check out the Useful Snippets page, which includes even more sample code written by the community!
CORS support
Unfortunately, due to the same-origin policy by default isomorphic-git can only clone from the same origin as the webpage it is running on. This is terribly inconvenient, as it means for all practical purposes cloning and pushing repos must be done through a proxy.
For this purpose, @isomorphic-git/cors-proxy exists; which you can clone it or npm install it. Alternatively, use CloudFlare workers, which can be setup without leaving the browser (instructions).
isomorphic-git is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.
What does isomorphic-git do?
A pure JavaScript implementation of git for node and browsers!
What is isomorphic-git written in?
isomorphic-git is primarily written in JavaScript. Its source is publicly available at https://github.com/isomorphic-git/isomorphic-git, and it has 8,354 GitHub stars.