Overview
ThecreateGit() function creates a new Git instance with custom configuration options. This is the primary way to initialize the useGit library and set up your working directory and debug settings.
Syntax
Parameters
Configuration options for the Git instance
Returns
Returns a new Git instance with all available Git methods. The instance includes all methods from the library including
init, clone, commit, branch, and more.Usage Examples
Basic Usage
Create a Git instance with default settings:Custom Working Directory
Specify a custom working directory:Debug Mode
Enable debug mode to see detailed Git command output:Multiple Instances
Create multiple Git instances for different directories:Default Export
The library also provides a default Git instance for convenience:git export is equivalent to calling createGit() with no options.
The default
git instance uses the current working directory (.) and has debug mode disabled.Source Code
Location:src/index.ts:9