Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nfriend/ts-git

A naïve implementation of git, written in TypeScript. Built to help me understand how git works under the hood.
https://github.com/nfriend/ts-git

Last synced: about 1 month ago
JSON representation

A naïve implementation of git, written in TypeScript. Built to help me understand how git works under the hood.

Awesome Lists containing this project

README

        

# ts-git

ts-git logo

A naïve implementation of [git](https://git-scm.com/), written in [TypeScript](https://www.typescriptlang.org/): 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!](https://wyag.thb.lt/#org94e7cd7) tutorial.

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

This repo contains the source the [`ts-git` library](./lib) and the [`ts-git` demo app](./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:

```bash
npm install @nathanfriend/ts-git --save
```

Then, import and use the module:

```ts
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`](./lib) directory in this repo.

### Command line usage

First, install the `ts-git` module globally:

```bash
npm install -g @nathanfriend/ts-git
```

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

```bash
ts-git init
```

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