クイックスタート
インストール
npm install type-gitpnpm add type-gitimport { TypeGit } from 'npm:type-git';import { denoAdapter } from 'npm:type-git/deno';bun add type-git基本的な使い方
TypeGitクラスを使用(推奨)
import { TypeGit } from 'type-git';import { nodeAdapter } from 'type-git/node';
const git = new TypeGit(nodeAdapter);
// リポジトリをクローンawait git.clone('https://github.com/user/repo.git', './my-repo');
// 既存のリポジトリを開くconst repo = await git.open('./my-repo');
// ステータスを確認const status = await repo.status();console.log('変更されたファイル:', status.files.filter(f => f.isModified));ファクトリ関数を使用
import { createGit } from 'type-git';import { nodeAdapter } from 'type-git/node';
const git = createGit(nodeAdapter);