What problem does it solve?
It helps you reliably perform common Git operations from TypeScript using the simple-git library, including status, logs, diffs, checkout, and raw Git commands, without juggling ad-hoc shell parsing.
Core Features & Use Cases
- Per-repo simpleGit instance setup: Create a lightweight instance per repository working directory to avoid singleton state issues and keep a predictable task queue.
- Core Git workflows: Use status to check cleanliness and file change codes, log to summarize history, and diff to get unstaged or staged changes.
- Branch and plumbing commands: Perform checkouts with fetch+fallback behavior, resolve repo root paths, and run advanced operations via raw for any commands not wrapped by simple-git.
- Error handling patterns: Catch GitError and understand when GitResponseError indicates parsed-response problems (even if Git exit code is success).
Quick Start
Use the simple-git Reference to create an instance for your repository and call status to get the current branch name, clean/dirty state, and the list of changed files with their status codes.