Welcome to useGit
useGit is a modern, promise-based Git utility library designed to make Git operations in Node.js straightforward and type-safe. Built with TypeScript, it provides a clean, intuitive API for all your Git automation needs.Why useGit?
Promise-Based
All operations return promises, making it perfect for async/await workflows and modern JavaScript applications.
Type-Safe
Written in TypeScript with full type definitions, giving you autocomplete and compile-time safety.
Comprehensive API
Covers all essential Git operations: init, clone, add, commit, branch, tag, diff, status, and more.
Flexible Configuration
Create multiple Git instances with different working directories and pass custom flags to any command.
Key Features
Simple and Intuitive
Working with Git should be straightforward. useGit provides a clean API that mirrors Git’s own command structure:Multiple Repository Support
Create separate Git instances for different repositories:Rich API Surface
useGit provides specialized functions for common operations:- Status & Inspection:
isDirty,isCleanWorkingTree,hasUntrackedFiles - Branching:
createBranch,currentBranch,listBranches,deleteBranch - Tagging:
createTag,createAnnotatedTag,getTags,getSemverTags - Diffs:
diff,diffStaged,diffStats,hasStagedDiff - Commits:
commit,commitAll,commitAmend,commitSignoff
Get Started
Installation
Install useGit via npm, yarn, or pnpm and set up your project
Quick Start
Follow a step-by-step guide to get up and running in minutes
API Reference
Explore the complete API documentation with examples
GitHub
View the source code and contribute on GitHub