Skip to content

type-git

Type-safe Git operations with progress tracking and abort control

Features

Type-safe API

Full TypeScript support with proper type inference and branded types for compile-time safety

Multi-runtime

Works seamlessly with Node.js, Deno, and Bun through runtime-specific adapters

Git LFS Support

Built-in LFS support with real-time progress tracking for large file operations

Abort Control

Cancel long-running operations using the standard AbortController API

Quick Example

import { TypeGit } from 'type-git';
import { nodeAdapter } from 'type-git/node';
const git = new TypeGit(nodeAdapter);
// Clone with progress tracking
await git.clone('https://github.com/user/repo.git', './repo', {
progress: (p) => console.log(`${p.phase}: ${p.percent}%`),
});
// Open and work with repository
const repo = await git.open('./repo');
const status = await repo.status();
console.log(status.files);