Home

Awesome

ts-git

<img alt="ts-git logo" src="ts-git.png" width="250" height="250" />

A naïve implementation of git, written in TypeScript: http://ts-git.nathanfriend.io. Built to help me understand how git works under the hood.

This implementation is heavily based on the excellent Write yourself a Git! tutorial.

Please don't actually use ts-git for anything serious :joy:.

This repo contains the source the ts-git library and the ts-git demo app.

Usage

The ts-git library can be used in two ways: as an ES6 JavaScript module or as a command line utility.

JavaScript module usage

This module is designed to work both in the browser and on the server (in Node).

First, install the module:

npm install @nathanfriend/ts-git --save

Then, import and use the module:

import { TsGit } from '@nathanfriend/ts-git';

const tsGit = new TsGit();

// View the documentation in the /lib directory
// of this repo for more usage details

More complete usage details can be found in the lib directory in this repo.

Command line usage

First, install the ts-git module globally:

npm install -g @nathanfriend/ts-git

Then use the ts-git command as a drop-in replacement for git:

ts-git init

To the see the list of available commands, run ts-git --help.