Skip to content

Quick Start

Installation

Terminal window
npm install type-git

Basic Usage

import { TypeGit } from 'type-git';
import { nodeAdapter } from 'type-git/node';
const git = new TypeGit(nodeAdapter);
// Clone a repository
await git.clone('https://github.com/user/repo.git', './my-repo');
// Open existing repository
const repo = await git.open('./my-repo');
// Check status
const status = await repo.status();
console.log('Modified files:', status.files.filter(f => f.isModified));

Using Factory Function

import { createGit } from 'type-git';
import { nodeAdapter } from 'type-git/node';
const git = createGit(nodeAdapter);

Next Steps