Skip to content
⚠️ Alpha Release: TS-Git is work in progress and currently only supports a local subset of Git commands. View roadmap and limitations

TS-Git

A pure TypeScript Git implementation that runs entirely in the browser or Node.js

Pluggable Filesystem

Works with in-memory, browser storage, or native filesystems via adapter pattern

Minimal Dependencies

Lightweight core with only essential dependencies. Bring your own diff algorithm.

Well Tested

Comprehensive test suite with 470+ tests

Browser Native

Run Git operations directly in the browser

Type Safe

Fully typed with TypeScript for excellent developer experience

Git Compatible

Standard Git API with familiar commands. Includes interoperability tests to ensure compatibility with existing repositories and the canonical Git CLI.

import { GitClient, MemoryFSAdapter } from '@keydown-app/ts-git';
// Create a filesystem adapter
const fs = new MemoryFSAdapter();
// Initialize Git client
const git = new GitClient({ fs, dir: '/my-repo' });
// Initialize a repository
await git.init({ defaultBranch: 'main' });
// Stage and commit files
await git.add('README.md');
await git.commit('Initial commit', {
name: 'John Doe',
email: 'john@example.com',
});
Terminal window
npm install @keydown-app/ts-git