コンテンツにスキップ

クイックスタート

インストール

Terminal window
npm install 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);

次のステップ