simple-git

  • Version 4.0.2
  • Published
  • 872 kB
  • 5 dependencies
  • MIT license

Install

npm i simple-git
yarn add simple-git
pnpm add simple-git

Overview

Simple GIT interface for node.js

Index

Variables

Functions

Classes

Interfaces

Enums

Type Aliases

Variables

variable simpleGit

const simpleGit: SimpleGitFactory;

    Functions

    function grepQueryBuilder

    grepQueryBuilder: (...params: string[]) => GitGrepQuery;
    • Creates a new builder for a git.grep query with optional params

    Classes

    class GitConstructError

    class GitConstructError extends GitError {}
    • The GitConstructError is thrown when an error occurs in the constructor of the simple-git instance itself. Most commonly as a result of using a baseDir option that points to a folder that either does not exist, or cannot be read by the user the node script is running as.

      Check the .message property for more detail including the properties passed to the constructor.

    constructor

    constructor(config: SimpleGitOptions, message: string);

      property config

      readonly config: SimpleGitOptions;

        class GitError

        class GitError extends Error {}
        • The GitError is thrown when the underlying git process throws a fatal exception (eg an ENOENT exception when attempting to use a non-writable directory as the root for your repo), and acts as the base class for more specific errors thrown by the parsing of the git response or errors in the configuration of the task about to be run.

          When an exception is thrown, pending tasks in the same instance will not be executed. The recommended way to run a series of tasks that can independently fail without needing to prevent future tasks from running is to catch them individually:

          import { simpleGit, SimpleGit, GitError, PullResult } from 'simple-git';
          function catchTask (e: GitError) {
          return e.
          }
          const git = simpleGit(repoWorkingDir);
          const pulled: PullResult | GitError = await git.pull().catch(catchTask);
          const pushed: string | GitError = await git.pushTags().catch(catchTask);

        constructor

        constructor(task?: SimpleGitTask<any>, message?: string);

          property task

          task?: SimpleGitTask<any>;

            class GitPluginError

            class GitPluginError extends GitError {}

              constructor

              constructor(
              task?: SimpleGitTask<any>,
              plugin?: keyof SimpleGitOptions,
              message?: string
              );

                property plugin

                readonly plugin?: keyof SimpleGitOptions;

                  property task

                  task?: SimpleGitTask<any>;

                    class GitResponseError

                    class GitResponseError<T = any> extends GitError {}
                    • The GitResponseError is the wrapper for a parsed response that is treated as a fatal error, for example attempting a merge can leave the repo in a corrupted state when there are conflicts so the task will reject rather than resolve.

                      For example, catching the merge conflict exception:

                      import { simpleGit, SimpleGit, GitResponseError, MergeSummary } from 'simple-git';
                      const git = simpleGit(repoRoot);
                      const mergeOptions: string[] = ['--no-ff', 'other-branch'];
                      const mergeSummary: MergeSummary = await git.merge(mergeOptions)
                      .catch((e: GitResponseError<MergeSummary>) => e.git);
                      if (mergeSummary.failed) {
                      // deal with the error
                      }

                    constructor

                    constructor(git: {}, message?: string);

                      property git

                      readonly git: {};
                      • .git access the parsed response that is treated as being an error

                      class TaskConfigurationError

                      class TaskConfigurationError extends GitError {}
                      • The TaskConfigurationError is thrown when a command was incorrectly configured. An error of this kind means that no attempt was made to run your command through the underlying git binary.

                        Check the .message property for more detail on why your configuration resulted in an error.

                      constructor

                      constructor(message?: string);

                        Interfaces

                        interface BranchMultiDeleteResult

                        interface BranchMultiDeleteResult {}
                        • Represents the status of having deleted a batch of branches

                        property all

                        all: BranchSingleDeleteResult[];
                        • All branches included in the response

                        property branches

                        branches: {
                        [branchName: string]: BranchSingleDeleteResult;
                        };
                        • Branches mapped by their branch name

                        property errors

                        errors: BranchSingleDeleteResult[];
                        • Array of responses that are in error

                        property success

                        readonly success: boolean;
                        • Flag showing whether all branches were deleted successfully

                        interface BranchSingleDeleteFailure

                        interface BranchSingleDeleteFailure {}
                        • Represents the failure to delete a single branch

                        property branch

                        branch: string;

                          property hash

                          hash: null;

                            property success

                            success: false;

                              interface BranchSingleDeleteSuccess

                              interface BranchSingleDeleteSuccess {}
                              • Represents the successful deletion of a single branch

                              property branch

                              branch: string;

                                property hash

                                hash: string;

                                  property success

                                  success: true;

                                    interface BranchSummary

                                    interface BranchSummary {}

                                      property all

                                      all: string[];

                                        property branches

                                        branches: {
                                        [key: string]: BranchSummaryBranch;
                                        };

                                          property current

                                          current: string;

                                            property detached

                                            detached: boolean;

                                              interface BranchSummaryBranch

                                              interface BranchSummaryBranch {}

                                                property commit

                                                commit: string;

                                                  property current

                                                  current: boolean;

                                                    property label

                                                    label: string;

                                                      property linkedWorkTree

                                                      linkedWorkTree: boolean;

                                                        property name

                                                        name: string;

                                                          interface CleanSummary

                                                          interface CleanSummary {}

                                                            property dryRun

                                                            readonly dryRun: boolean;

                                                              property files

                                                              readonly files: string[];

                                                                property folders

                                                                readonly folders: string[];

                                                                  property paths

                                                                  readonly paths: string[];

                                                                    interface CommitResult

                                                                    interface CommitResult {}

                                                                      property author

                                                                      author: null | {
                                                                      email: string;
                                                                      name: string;
                                                                      };

                                                                        property branch

                                                                        branch: string;

                                                                          property commit

                                                                          commit: string;

                                                                            property root

                                                                            root: boolean;

                                                                              property summary

                                                                              summary: {
                                                                              changes: number;
                                                                              insertions: number;
                                                                              deletions: number;
                                                                              };

                                                                                interface ConfigGetResult

                                                                                interface ConfigGetResult {}
                                                                                • Represents the response to using git.getConfig

                                                                                property key

                                                                                key: string;
                                                                                • The key that was searched for

                                                                                property paths

                                                                                paths: string[];
                                                                                • The file paths from which configuration was read

                                                                                property scopes

                                                                                scopes: Map<string, string[]>;
                                                                                • The full hierarchy of values the property can have had across the various scopes that were searched (keys in this Map are the strings also found in the paths array).

                                                                                property value

                                                                                value: string | null;
                                                                                • The single value seen by git for this key (equivalent to git config --get key)

                                                                                property values

                                                                                values: string[];
                                                                                • All possible values for this key no matter the scope (equivalent to git config --get-all key)

                                                                                interface ConfigListSummary

                                                                                interface ConfigListSummary {}
                                                                                • Represents the current git configuration, as defined by the output from git log

                                                                                property all

                                                                                readonly all: ConfigValues;
                                                                                • All configuration settings, where local/user settings override user/global settings the overridden value will appear in this object.

                                                                                property files

                                                                                files: string[];
                                                                                • The file paths configuration was read from

                                                                                property values

                                                                                values: {
                                                                                [fileName: string]: ConfigValues;
                                                                                };
                                                                                • The ConfigValues for each of the files, use this object to determine local repo, user and global settings.

                                                                                interface ConfigValues

                                                                                interface ConfigValues {}
                                                                                • Represents the map of configuration settings

                                                                                index signature

                                                                                [key: string]: string | string[];

                                                                                  interface CountObjectsResult

                                                                                  interface CountObjectsResult {}

                                                                                    property count

                                                                                    count: number;

                                                                                      property garbage

                                                                                      garbage: number;

                                                                                        property inPack

                                                                                        inPack: number;

                                                                                          property packs

                                                                                          packs: number;

                                                                                            property prunePackable

                                                                                            prunePackable: number;

                                                                                              property size

                                                                                              size: number;

                                                                                                property sizeGarbage

                                                                                                sizeGarbage: number;

                                                                                                  property sizePack

                                                                                                  sizePack: number;

                                                                                                    interface DefaultLogFields

                                                                                                    interface DefaultLogFields {}

                                                                                                      property author_email

                                                                                                      author_email: string;

                                                                                                        property author_name

                                                                                                        author_name: string;

                                                                                                          property body

                                                                                                          body: string;

                                                                                                            property date

                                                                                                            date: string;

                                                                                                              property hash

                                                                                                              hash: string;

                                                                                                                property message

                                                                                                                message: string;

                                                                                                                  property refs

                                                                                                                  refs: string;

                                                                                                                    interface DiffResult

                                                                                                                    interface DiffResult {}

                                                                                                                      property changed

                                                                                                                      changed: number;
                                                                                                                      • The total number of files changed as reported in the summary line

                                                                                                                      property deletions

                                                                                                                      deletions: number;
                                                                                                                      • The number of files changed with deletions

                                                                                                                      property files

                                                                                                                      files: Array<
                                                                                                                      DiffResultTextFile | DiffResultBinaryFile | DiffResultNameStatusFile
                                                                                                                      >;
                                                                                                                      • When present in the diff, lists the details of each file changed

                                                                                                                      property insertions

                                                                                                                      insertions: number;
                                                                                                                      • The number of files changed with insertions

                                                                                                                      interface DiffResultBinaryFile

                                                                                                                      interface DiffResultBinaryFile {}

                                                                                                                        property after

                                                                                                                        after: number;

                                                                                                                          property before

                                                                                                                          before: number;

                                                                                                                            property binary

                                                                                                                            binary: true;

                                                                                                                              property file

                                                                                                                              file: string;

                                                                                                                                interface DiffResultNameStatusFile

                                                                                                                                interface DiffResultNameStatusFile extends DiffResultTextFile {}
                                                                                                                                • --name-status argument needed

                                                                                                                                property from

                                                                                                                                from?: string;

                                                                                                                                  property similarity

                                                                                                                                  similarity: number;

                                                                                                                                    property status

                                                                                                                                    status?: DiffNameStatus;

                                                                                                                                      interface DiffResultTextFile

                                                                                                                                      interface DiffResultTextFile {}

                                                                                                                                        property binary

                                                                                                                                        binary: false;

                                                                                                                                          property changes

                                                                                                                                          changes: number;

                                                                                                                                            property deletions

                                                                                                                                            deletions: number;

                                                                                                                                              property file

                                                                                                                                              file: string;

                                                                                                                                                property insertions

                                                                                                                                                insertions: number;

                                                                                                                                                  interface FetchResult

                                                                                                                                                  interface FetchResult {}

                                                                                                                                                    property branches

                                                                                                                                                    branches: {
                                                                                                                                                    name: string;
                                                                                                                                                    tracking: string;
                                                                                                                                                    }[];

                                                                                                                                                      property deleted

                                                                                                                                                      deleted: {
                                                                                                                                                      tracking: string;
                                                                                                                                                      }[];

                                                                                                                                                        property raw

                                                                                                                                                        raw: string;

                                                                                                                                                          property remote

                                                                                                                                                          remote: string | null;

                                                                                                                                                            property tags

                                                                                                                                                            tags: {
                                                                                                                                                            name: string;
                                                                                                                                                            tracking: string;
                                                                                                                                                            }[];

                                                                                                                                                              property updated

                                                                                                                                                              updated: {
                                                                                                                                                              name: string;
                                                                                                                                                              tracking: string;
                                                                                                                                                              to: string;
                                                                                                                                                              from: string;
                                                                                                                                                              }[];

                                                                                                                                                                interface FileStatusResult

                                                                                                                                                                interface FileStatusResult {}

                                                                                                                                                                  property from

                                                                                                                                                                  from?: string;
                                                                                                                                                                  • Original location of the file, when the file has been moved

                                                                                                                                                                  property index

                                                                                                                                                                  index: string;
                                                                                                                                                                  • First digit of the status code of the file, e.g. 'M' = modified. Represents the status of the index if no merge conflicts, otherwise represents status of one side of the merge.

                                                                                                                                                                  property path

                                                                                                                                                                  path: string;
                                                                                                                                                                  • Path of the file

                                                                                                                                                                  property working_dir

                                                                                                                                                                  working_dir: string;
                                                                                                                                                                  • Second digit of the status code of the file. Represents status of the working directory if no merge conflicts, otherwise represents status of other side of a merge. See https://git-scm.com/docs/git-status#_short_format for full documentation of possible values and their meanings.

                                                                                                                                                                  interface GitGrepQuery

                                                                                                                                                                  interface GitGrepQuery extends Iterable<string> {}

                                                                                                                                                                    method and

                                                                                                                                                                    and: (...and: string[]) => this;
                                                                                                                                                                    • Adds one or more terms to be grouped as an "and" to any other terms

                                                                                                                                                                    method param

                                                                                                                                                                    param: (...param: string[]) => this;
                                                                                                                                                                    • Adds one or more search terms - git.grep will "or" this to other terms

                                                                                                                                                                    interface GrepResult

                                                                                                                                                                    interface GrepResult {}
                                                                                                                                                                    • Represents the response to git.grep

                                                                                                                                                                    property paths

                                                                                                                                                                    paths: Set<string>;

                                                                                                                                                                      property results

                                                                                                                                                                      results: Record<
                                                                                                                                                                      string,
                                                                                                                                                                      Array<{
                                                                                                                                                                      line: number;
                                                                                                                                                                      path: string;
                                                                                                                                                                      preview: string;
                                                                                                                                                                      }>
                                                                                                                                                                      >;

                                                                                                                                                                        interface InitResult

                                                                                                                                                                        interface InitResult {}
                                                                                                                                                                        • The InitResult is returned when (re)initialising a git repo.

                                                                                                                                                                        property bare

                                                                                                                                                                        readonly bare: boolean;
                                                                                                                                                                        • Boolean representing whether the --bare option was used

                                                                                                                                                                        property existing

                                                                                                                                                                        readonly existing: boolean;
                                                                                                                                                                        • Boolean representing whether the repo already existed (re-initialised rather than initialised)

                                                                                                                                                                        property gitDir

                                                                                                                                                                        readonly gitDir: string;
                                                                                                                                                                        • The git configuration directory - for a bare repo this is the same as path, in non-bare repos this will usually be a sub-directory with the name .git (or value of the $GIT_DIR environment variable).

                                                                                                                                                                        property path

                                                                                                                                                                        readonly path: string;
                                                                                                                                                                        • The path used when initialising

                                                                                                                                                                        interface ListLogLine

                                                                                                                                                                        interface ListLogLine {}
                                                                                                                                                                        • The ListLogLine represents a single entry in the git.log, the properties on the object are mixed in depending on the names used in the format (see DefaultLogFields), but some properties are dependent on the command used.

                                                                                                                                                                        property diff

                                                                                                                                                                        diff?: DiffResult;
                                                                                                                                                                        • When using a --stat=4096 or --shortstat options in the git.log or git.stashList, each entry in the ListLogSummary will also have a diff property representing as much detail as was given in the response.

                                                                                                                                                                        interface LogResult

                                                                                                                                                                        interface LogResult<T = DefaultLogFields> {}

                                                                                                                                                                          property all

                                                                                                                                                                          all: ReadonlyArray<T & ListLogLine>;

                                                                                                                                                                            property latest

                                                                                                                                                                            latest: (T & ListLogLine) | null;

                                                                                                                                                                              property total

                                                                                                                                                                              total: number;

                                                                                                                                                                                interface MergeConflict

                                                                                                                                                                                interface MergeConflict {}
                                                                                                                                                                                • Represents a single file with conflicts in the MergeSummary

                                                                                                                                                                                property file

                                                                                                                                                                                file: string | null;
                                                                                                                                                                                • Path to file

                                                                                                                                                                                property meta

                                                                                                                                                                                meta?: MergeConflictDeletion;
                                                                                                                                                                                • Additional detail for the specific type of conflict

                                                                                                                                                                                property reason

                                                                                                                                                                                reason: string;
                                                                                                                                                                                • Type of conflict

                                                                                                                                                                                interface MergeConflictDeletion

                                                                                                                                                                                interface MergeConflictDeletion {}
                                                                                                                                                                                • Where the file was deleted, if there is a modify/delete conflict

                                                                                                                                                                                property deleteRef

                                                                                                                                                                                deleteRef: string;

                                                                                                                                                                                  interface MergeDetail

                                                                                                                                                                                  interface MergeDetail {}

                                                                                                                                                                                    property conflicts

                                                                                                                                                                                    conflicts: MergeConflict[];

                                                                                                                                                                                      property failed

                                                                                                                                                                                      readonly failed: boolean;

                                                                                                                                                                                        property merges

                                                                                                                                                                                        merges: string[];

                                                                                                                                                                                          property result

                                                                                                                                                                                          result: MergeResultStatus;

                                                                                                                                                                                            interface MoveResult

                                                                                                                                                                                            interface MoveResult {}
                                                                                                                                                                                            • A parsed response summary for calls to git mv

                                                                                                                                                                                            property moves

                                                                                                                                                                                            moves: Array<{
                                                                                                                                                                                            from: string;
                                                                                                                                                                                            to: string;
                                                                                                                                                                                            }>;
                                                                                                                                                                                            • Array of files moved

                                                                                                                                                                                            interface PullDetail

                                                                                                                                                                                            interface PullDetail {}

                                                                                                                                                                                              property created

                                                                                                                                                                                              created: string[];
                                                                                                                                                                                              • Array of file names that have been created

                                                                                                                                                                                              property deleted

                                                                                                                                                                                              deleted: string[];
                                                                                                                                                                                              • Array of file names that have been deleted

                                                                                                                                                                                              property deletions

                                                                                                                                                                                              deletions: PullDetailFileChanges;
                                                                                                                                                                                              • Map of file names to the number of deletions in that file

                                                                                                                                                                                              property files

                                                                                                                                                                                              files: string[];
                                                                                                                                                                                              • Array of all files that are referenced in the pull

                                                                                                                                                                                              property insertions

                                                                                                                                                                                              insertions: PullDetailFileChanges;
                                                                                                                                                                                              • Map of file names to the number of insertions in that file

                                                                                                                                                                                              property summary

                                                                                                                                                                                              summary: PullDetailSummary;

                                                                                                                                                                                                interface PullDetailFileChanges

                                                                                                                                                                                                interface PullDetailFileChanges {}

                                                                                                                                                                                                  index signature

                                                                                                                                                                                                  [fileName: string]: number;

                                                                                                                                                                                                    interface PullDetailSummary

                                                                                                                                                                                                    interface PullDetailSummary {}

                                                                                                                                                                                                      property changes

                                                                                                                                                                                                      changes: number;

                                                                                                                                                                                                        property deletions

                                                                                                                                                                                                        deletions: number;

                                                                                                                                                                                                          property insertions

                                                                                                                                                                                                          insertions: number;

                                                                                                                                                                                                            interface PullFailedResult

                                                                                                                                                                                                            interface PullFailedResult {}
                                                                                                                                                                                                            • Wrapped with the GitResponseError as the exception thrown from a git.pull task to provide additional detail as to what failed.

                                                                                                                                                                                                            property branch

                                                                                                                                                                                                            branch: {
                                                                                                                                                                                                            local: string;
                                                                                                                                                                                                            remote: string;
                                                                                                                                                                                                            };

                                                                                                                                                                                                              property hash

                                                                                                                                                                                                              hash: {
                                                                                                                                                                                                              local: string;
                                                                                                                                                                                                              remote: string;
                                                                                                                                                                                                              };

                                                                                                                                                                                                                property message

                                                                                                                                                                                                                message: string;

                                                                                                                                                                                                                  property remote

                                                                                                                                                                                                                  remote: string;

                                                                                                                                                                                                                    interface PullResult

                                                                                                                                                                                                                    interface PullResult extends PullDetail, RemoteMessageResult {}

                                                                                                                                                                                                                      interface PushDetail

                                                                                                                                                                                                                      interface PushDetail {}

                                                                                                                                                                                                                        property branch

                                                                                                                                                                                                                        branch?: {
                                                                                                                                                                                                                        local: string;
                                                                                                                                                                                                                        remote: string;
                                                                                                                                                                                                                        remoteName: string;
                                                                                                                                                                                                                        };

                                                                                                                                                                                                                          property pushed

                                                                                                                                                                                                                          pushed: PushResultPushedItem[];

                                                                                                                                                                                                                            property ref

                                                                                                                                                                                                                            ref?: {
                                                                                                                                                                                                                            local: string;
                                                                                                                                                                                                                            };

                                                                                                                                                                                                                              property repo

                                                                                                                                                                                                                              repo?: string;

                                                                                                                                                                                                                                property update

                                                                                                                                                                                                                                update?: PushResultBranchUpdate;

                                                                                                                                                                                                                                  interface PushResult

                                                                                                                                                                                                                                  interface PushResult
                                                                                                                                                                                                                                  extends PushDetail,
                                                                                                                                                                                                                                  RemoteMessageResult<PushResultRemoteMessages> {}

                                                                                                                                                                                                                                    interface PushResultBranchUpdate

                                                                                                                                                                                                                                    interface PushResultBranchUpdate {}

                                                                                                                                                                                                                                      property hash

                                                                                                                                                                                                                                      hash: {
                                                                                                                                                                                                                                      from: string;
                                                                                                                                                                                                                                      to: string;
                                                                                                                                                                                                                                      };

                                                                                                                                                                                                                                        property head

                                                                                                                                                                                                                                        head: {
                                                                                                                                                                                                                                        local: string;
                                                                                                                                                                                                                                        remote: string;
                                                                                                                                                                                                                                        };

                                                                                                                                                                                                                                          interface PushResultPushedItem

                                                                                                                                                                                                                                          interface PushResultPushedItem {}

                                                                                                                                                                                                                                          property alreadyUpdated

                                                                                                                                                                                                                                          readonly alreadyUpdated: boolean;

                                                                                                                                                                                                                                            property branch

                                                                                                                                                                                                                                            readonly branch: boolean;

                                                                                                                                                                                                                                              property deleted

                                                                                                                                                                                                                                              readonly deleted: boolean;

                                                                                                                                                                                                                                                property local

                                                                                                                                                                                                                                                local: string;

                                                                                                                                                                                                                                                  property new

                                                                                                                                                                                                                                                  readonly new: boolean;

                                                                                                                                                                                                                                                    property remote

                                                                                                                                                                                                                                                    remote: string;

                                                                                                                                                                                                                                                      property tag

                                                                                                                                                                                                                                                      readonly tag: boolean;

                                                                                                                                                                                                                                                        interface PushResultRemoteMessages

                                                                                                                                                                                                                                                        interface PushResultRemoteMessages extends RemoteMessages {}

                                                                                                                                                                                                                                                          property pullRequestUrl

                                                                                                                                                                                                                                                          pullRequestUrl?: string;

                                                                                                                                                                                                                                                            property vulnerabilities

                                                                                                                                                                                                                                                            vulnerabilities?: {
                                                                                                                                                                                                                                                            count: number;
                                                                                                                                                                                                                                                            summary: string;
                                                                                                                                                                                                                                                            url: string;
                                                                                                                                                                                                                                                            };

                                                                                                                                                                                                                                                              interface RemoteMessageResult

                                                                                                                                                                                                                                                              interface RemoteMessageResult<T extends RemoteMessages = RemoteMessages> {}

                                                                                                                                                                                                                                                                property remoteMessages

                                                                                                                                                                                                                                                                remoteMessages: T;

                                                                                                                                                                                                                                                                  interface RemoteMessages

                                                                                                                                                                                                                                                                  interface RemoteMessages {}

                                                                                                                                                                                                                                                                    property all

                                                                                                                                                                                                                                                                    all: string[];

                                                                                                                                                                                                                                                                      property objects

                                                                                                                                                                                                                                                                      objects?: RemoteMessagesObjectEnumeration;

                                                                                                                                                                                                                                                                        interface RemoteMessagesObjectEnumeration

                                                                                                                                                                                                                                                                        interface RemoteMessagesObjectEnumeration {}

                                                                                                                                                                                                                                                                          property compressing

                                                                                                                                                                                                                                                                          compressing: number;

                                                                                                                                                                                                                                                                            property counting

                                                                                                                                                                                                                                                                            counting: number;

                                                                                                                                                                                                                                                                              property enumerating

                                                                                                                                                                                                                                                                              enumerating: number;

                                                                                                                                                                                                                                                                                property packReused

                                                                                                                                                                                                                                                                                packReused: number;

                                                                                                                                                                                                                                                                                  property reused

                                                                                                                                                                                                                                                                                  reused: {
                                                                                                                                                                                                                                                                                  count: number;
                                                                                                                                                                                                                                                                                  delta: number;
                                                                                                                                                                                                                                                                                  };

                                                                                                                                                                                                                                                                                    property total

                                                                                                                                                                                                                                                                                    total: {
                                                                                                                                                                                                                                                                                    count: number;
                                                                                                                                                                                                                                                                                    delta: number;
                                                                                                                                                                                                                                                                                    };

                                                                                                                                                                                                                                                                                      interface RemoteWithoutRefs

                                                                                                                                                                                                                                                                                      interface RemoteWithoutRefs {}

                                                                                                                                                                                                                                                                                        property name

                                                                                                                                                                                                                                                                                        name: string;

                                                                                                                                                                                                                                                                                          interface RemoteWithRefs

                                                                                                                                                                                                                                                                                          interface RemoteWithRefs extends RemoteWithoutRefs {}

                                                                                                                                                                                                                                                                                            property refs

                                                                                                                                                                                                                                                                                            refs: {
                                                                                                                                                                                                                                                                                            fetch: string;
                                                                                                                                                                                                                                                                                            push: string;
                                                                                                                                                                                                                                                                                            };

                                                                                                                                                                                                                                                                                              interface SimpleGit

                                                                                                                                                                                                                                                                                              interface SimpleGit extends SimpleGitBase {}

                                                                                                                                                                                                                                                                                                method addAnnotatedTag

                                                                                                                                                                                                                                                                                                addAnnotatedTag: (
                                                                                                                                                                                                                                                                                                tagName: string,
                                                                                                                                                                                                                                                                                                tagMessage: string,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<{ name: string }>
                                                                                                                                                                                                                                                                                                ) => Response<{ name: string }>;
                                                                                                                                                                                                                                                                                                • Add an annotated tag to the head of the current branch

                                                                                                                                                                                                                                                                                                method addConfig

                                                                                                                                                                                                                                                                                                addConfig: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                key: string,
                                                                                                                                                                                                                                                                                                value: string,
                                                                                                                                                                                                                                                                                                append?: boolean,
                                                                                                                                                                                                                                                                                                scope?: keyof typeof GitConfigScope,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                key: string,
                                                                                                                                                                                                                                                                                                value: string,
                                                                                                                                                                                                                                                                                                append?: boolean,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                key: string,
                                                                                                                                                                                                                                                                                                value: string,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Add config to local git instance for the specified key (eg: user.name) and value (eg: 'your name'). Set append to true to append to rather than overwrite the key

                                                                                                                                                                                                                                                                                                method addRemote

                                                                                                                                                                                                                                                                                                addRemote: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                remoteName: string,
                                                                                                                                                                                                                                                                                                remoteRepo: string,
                                                                                                                                                                                                                                                                                                options?: TaskOptions,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                remoteName: string,
                                                                                                                                                                                                                                                                                                remoteRepo: string,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Adds a remote to the list of remotes.

                                                                                                                                                                                                                                                                                                  - remoteName Name of the repository - eg "upstream" - remoteRepo Fully qualified SSH or HTTP(S) path to the remote repo - options Optional additional settings permitted by the git remote add command, merged into the command prior to the repo name and remote url

                                                                                                                                                                                                                                                                                                method addTag

                                                                                                                                                                                                                                                                                                addTag: (
                                                                                                                                                                                                                                                                                                name: string,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<{ name: string }>
                                                                                                                                                                                                                                                                                                ) => Response<{ name: string }>;
                                                                                                                                                                                                                                                                                                • Add a lightweight tag to the head of the current branch

                                                                                                                                                                                                                                                                                                method applyPatch

                                                                                                                                                                                                                                                                                                applyPatch: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                patches: string | string[],
                                                                                                                                                                                                                                                                                                options: TaskOptions<ApplyOptions>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                patches: string | string[],
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Applies a patch to the repo

                                                                                                                                                                                                                                                                                                method binaryCatFile

                                                                                                                                                                                                                                                                                                binaryCatFile: (
                                                                                                                                                                                                                                                                                                options: string[],
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<any>
                                                                                                                                                                                                                                                                                                ) => Response<any>;
                                                                                                                                                                                                                                                                                                • Equivalent to catFile but will return the native Buffer of content from the git command's stdout.

                                                                                                                                                                                                                                                                                                method branch

                                                                                                                                                                                                                                                                                                branch: (
                                                                                                                                                                                                                                                                                                options?: TaskOptions,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<BranchSummary>
                                                                                                                                                                                                                                                                                                ) => Response<BranchSummary>;
                                                                                                                                                                                                                                                                                                • List all branches

                                                                                                                                                                                                                                                                                                method branchLocal

                                                                                                                                                                                                                                                                                                branchLocal: (
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<BranchSummary>
                                                                                                                                                                                                                                                                                                ) => Response<BranchSummary>;
                                                                                                                                                                                                                                                                                                • List of local branches

                                                                                                                                                                                                                                                                                                method catFile

                                                                                                                                                                                                                                                                                                catFile: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                options: string[],
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (callback?: SimpleGitTaskCallback<string, GitError>): Response<string>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Returns a list of objects in a tree based on commit hash. Passing in an object hash returns the object's content, size, and type.

                                                                                                                                                                                                                                                                                                  Passing "-p" will instruct cat-file to determine the object type, and display its formatted contents.

                                                                                                                                                                                                                                                                                                  See Also

                                                                                                                                                                                                                                                                                                  • https://git-scm.com/docs/git-cat-file

                                                                                                                                                                                                                                                                                                method checkIgnore

                                                                                                                                                                                                                                                                                                checkIgnore: {
                                                                                                                                                                                                                                                                                                (pathNames: string[], callback?: SimpleGitTaskCallback<string[]>): Response<
                                                                                                                                                                                                                                                                                                string[]
                                                                                                                                                                                                                                                                                                >;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                path: string,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string[], GitError>
                                                                                                                                                                                                                                                                                                ): Response<string[]>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Check if a pathname or pathnames are excluded by .gitignore

                                                                                                                                                                                                                                                                                                method checkIsRepo

                                                                                                                                                                                                                                                                                                checkIsRepo: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                action?: CheckRepoActions,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<boolean>
                                                                                                                                                                                                                                                                                                ): Response<boolean>;
                                                                                                                                                                                                                                                                                                (callback?: SimpleGitTaskCallback<boolean, GitError>): Response<boolean>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Validates that the current working directory is a valid git repo file path.

                                                                                                                                                                                                                                                                                                  To make a more specific assertion of the repo, add the action argument:

                                                                                                                                                                                                                                                                                                  - bare to validate that the working directory is inside a bare repo. - root to validate that the working directory is the root of a repo. - tree (default value when omitted) to simply validate that the working directory is the descendent of a repo

                                                                                                                                                                                                                                                                                                method checkout

                                                                                                                                                                                                                                                                                                checkout: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                what: string,
                                                                                                                                                                                                                                                                                                options?: TaskOptions,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                what: string,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                options?: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Checkout a tag or revision, any number of additional arguments can be passed to the git checkout command by supplying either a string or array of strings as the what parameter.

                                                                                                                                                                                                                                                                                                method checkoutBranch

                                                                                                                                                                                                                                                                                                checkoutBranch: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                branchName: string,
                                                                                                                                                                                                                                                                                                startPoint: string,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<void>
                                                                                                                                                                                                                                                                                                ): Response<void>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                branchName: string,
                                                                                                                                                                                                                                                                                                startPoint: string,
                                                                                                                                                                                                                                                                                                options?: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<void, GitError>
                                                                                                                                                                                                                                                                                                ): Response<void>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Checkout a remote branch - equivalent to git checkout -b ${branchName} ${startPoint}

                                                                                                                                                                                                                                                                                                  - branchName name of branch. - startPoint (e.g origin/development).

                                                                                                                                                                                                                                                                                                method checkoutLatestTag

                                                                                                                                                                                                                                                                                                checkoutLatestTag: (
                                                                                                                                                                                                                                                                                                branchName: string,
                                                                                                                                                                                                                                                                                                startPoint: string,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<void>
                                                                                                                                                                                                                                                                                                ) => Response<void>;
                                                                                                                                                                                                                                                                                                • Internally uses pull and tags to get the list of tags then checks out the latest tag.

                                                                                                                                                                                                                                                                                                method checkoutLocalBranch

                                                                                                                                                                                                                                                                                                checkoutLocalBranch: {
                                                                                                                                                                                                                                                                                                (branchName: string, callback?: SimpleGitTaskCallback<void>): Response<void>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                branchName: string,
                                                                                                                                                                                                                                                                                                options?: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<void, GitError>
                                                                                                                                                                                                                                                                                                ): Response<void>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Checkout a local branch - equivalent to git checkout -b ${branchName}

                                                                                                                                                                                                                                                                                                method clean

                                                                                                                                                                                                                                                                                                clean: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                args: CleanOptions[],
                                                                                                                                                                                                                                                                                                options?: TaskOptions,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<CleanSummary>
                                                                                                                                                                                                                                                                                                ): Response<CleanSummary>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                mode: string,
                                                                                                                                                                                                                                                                                                options?: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<CleanSummary, GitError>
                                                                                                                                                                                                                                                                                                ): Response<CleanSummary>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                mode: string,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<CleanSummary, GitError>
                                                                                                                                                                                                                                                                                                ): Response<CleanSummary>;
                                                                                                                                                                                                                                                                                                (options?: TaskOptions<Options>): Response<CleanSummary>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<CleanSummary, GitError>
                                                                                                                                                                                                                                                                                                ): Response<CleanSummary>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Deletes unwanted content from the local repo - when supplying the first argument as an array of CleanOptions, the array must include one of CleanOptions.FORCE or CleanOptions.DRY_RUN.

                                                                                                                                                                                                                                                                                                  eg:

                                                                                                                                                                                                                                                                                                  await git.clean(CleanOptions.FORCE);
                                                                                                                                                                                                                                                                                                  await git.clean(CleanOptions.DRY_RUN + CleanOptions.RECURSIVE);
                                                                                                                                                                                                                                                                                                  await git.clean(CleanOptions.FORCE, ['./path']);
                                                                                                                                                                                                                                                                                                  await git.clean(CleanOptions.IGNORED + CleanOptions.FORCE, {'./path': null});

                                                                                                                                                                                                                                                                                                method clone

                                                                                                                                                                                                                                                                                                clone: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                repoPath: string,
                                                                                                                                                                                                                                                                                                localPath: string,
                                                                                                                                                                                                                                                                                                options?: TaskOptions,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                repoPath: string,
                                                                                                                                                                                                                                                                                                options?: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Clone a repository into a new directory.

                                                                                                                                                                                                                                                                                                  - repoPath repository url to clone e.g. https://github.com/steveukx/git-js.git - localPath local folder path to clone to. - options supported by [git](https://git-scm.com/docs/git-clone).

                                                                                                                                                                                                                                                                                                method commit

                                                                                                                                                                                                                                                                                                commit: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                message: string | string[],
                                                                                                                                                                                                                                                                                                files?: string | string[],
                                                                                                                                                                                                                                                                                                options?: Options,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<CommitResult>
                                                                                                                                                                                                                                                                                                ): Response<CommitResult>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                message: string | string[],
                                                                                                                                                                                                                                                                                                options?: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<CommitResult, GitError>
                                                                                                                                                                                                                                                                                                ): Response<CommitResult>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                message: string | string[],
                                                                                                                                                                                                                                                                                                files?: string | string[],
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<CommitResult, GitError>
                                                                                                                                                                                                                                                                                                ): Response<CommitResult>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                message: string | string[],
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<CommitResult, GitError>
                                                                                                                                                                                                                                                                                                ): Response<CommitResult>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Commits changes in the current working directory - when specific file paths are supplied, only changes on those files will be committed.

                                                                                                                                                                                                                                                                                                method countObjects

                                                                                                                                                                                                                                                                                                countObjects: (
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<VersionResult>
                                                                                                                                                                                                                                                                                                ) => Response<CountObjectsResult>;
                                                                                                                                                                                                                                                                                                • Retrieves git disk usage information, see https://git-scm.com/docs/git-count-objects

                                                                                                                                                                                                                                                                                                method customBinary

                                                                                                                                                                                                                                                                                                customBinary: (command: Exclude<SimpleGitOptions['binary'], undefined>) => this;
                                                                                                                                                                                                                                                                                                • Sets the path to a custom git binary, should either be git when there is an installation of git available on the system path, or a fully qualified path to the executable.

                                                                                                                                                                                                                                                                                                method deleteLocalBranch

                                                                                                                                                                                                                                                                                                deleteLocalBranch: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                branchName: string,
                                                                                                                                                                                                                                                                                                forceDelete?: boolean,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<BranchSingleDeleteResult>
                                                                                                                                                                                                                                                                                                ): Response<BranchSingleDeleteResult>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                branchName: string,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<BranchSingleDeleteResult, GitError>
                                                                                                                                                                                                                                                                                                ): Response<BranchSingleDeleteResult>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Delete one local branch. Supply the branchName as a string to return a single BranchDeletionSummary instances.

                                                                                                                                                                                                                                                                                                  - branchName name of branch - forceDelete (optional, defaults to false) set to true to forcibly delete unmerged branches

                                                                                                                                                                                                                                                                                                method deleteLocalBranches

                                                                                                                                                                                                                                                                                                deleteLocalBranches: (
                                                                                                                                                                                                                                                                                                branchNames: string[],
                                                                                                                                                                                                                                                                                                forceDelete?: boolean,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<BranchMultiDeleteResult>
                                                                                                                                                                                                                                                                                                ) => Response<BranchMultiDeleteResult>;
                                                                                                                                                                                                                                                                                                • Delete one or more local branches. Supply the branchName as a string to return a single BranchDeletionSummary or as an array of branch names to return an array of BranchDeletionSummary instances.

                                                                                                                                                                                                                                                                                                  - branchNames name of branch or array of branch names - forceDelete (optional, defaults to false) set to true to forcibly delete unmerged branches

                                                                                                                                                                                                                                                                                                method diff

                                                                                                                                                                                                                                                                                                diff: (
                                                                                                                                                                                                                                                                                                options?: TaskOptions,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                ) => Response<string>;
                                                                                                                                                                                                                                                                                                • Get the diff of the current repo compared to the last commit with a set of options supplied as a string.

                                                                                                                                                                                                                                                                                                method diffSummary

                                                                                                                                                                                                                                                                                                diffSummary: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                command: string | number,
                                                                                                                                                                                                                                                                                                options: TaskOptions,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<DiffResult>
                                                                                                                                                                                                                                                                                                ): Response<DiffResult>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                command: string | number,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<DiffResult, GitError>
                                                                                                                                                                                                                                                                                                ): Response<DiffResult>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                options: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<DiffResult, GitError>
                                                                                                                                                                                                                                                                                                ): Response<DiffResult>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<DiffResult, GitError>
                                                                                                                                                                                                                                                                                                ): Response<DiffResult>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Gets a summary of the diff for files in the repo, uses the git diff --stat format to calculate changes.

                                                                                                                                                                                                                                                                                                  in order to get staged (only): --cached or --staged.

                                                                                                                                                                                                                                                                                                method env

                                                                                                                                                                                                                                                                                                env: { (name: string, value: string): this; (env: object): this };
                                                                                                                                                                                                                                                                                                • Sets an environment variable for the spawned child process, either supply both a name and value as strings or a single object to entirely replace the current environment variables.

                                                                                                                                                                                                                                                                                                  Parameter name

                                                                                                                                                                                                                                                                                                  Parameter value

                                                                                                                                                                                                                                                                                                method exec

                                                                                                                                                                                                                                                                                                exec: (handle: () => void) => Response<void>;
                                                                                                                                                                                                                                                                                                • Calls the supplied handle function at the next step in the chain, used to run arbitrary functions synchronously before the next task in the git API.

                                                                                                                                                                                                                                                                                                method fetch

                                                                                                                                                                                                                                                                                                fetch: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                remote: string,
                                                                                                                                                                                                                                                                                                branch: string,
                                                                                                                                                                                                                                                                                                options?: TaskOptions,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<FetchResult>
                                                                                                                                                                                                                                                                                                ): Response<FetchResult>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                remote: string,
                                                                                                                                                                                                                                                                                                branch: string,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<FetchResult, GitError>
                                                                                                                                                                                                                                                                                                ): Response<FetchResult>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                remote: string,
                                                                                                                                                                                                                                                                                                options?: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<FetchResult, GitError>
                                                                                                                                                                                                                                                                                                ): Response<FetchResult>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                options?: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<FetchResult, GitError>
                                                                                                                                                                                                                                                                                                ): Response<FetchResult>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<FetchResult, GitError>
                                                                                                                                                                                                                                                                                                ): Response<FetchResult>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Updates the local working copy database with changes from the default remote repo and branch.

                                                                                                                                                                                                                                                                                                method firstCommit

                                                                                                                                                                                                                                                                                                firstCommit: (callback?: SimpleGitTaskCallback<string>) => Response<string>;
                                                                                                                                                                                                                                                                                                • Gets the commit hash of the first commit in the repo

                                                                                                                                                                                                                                                                                                method getConfig

                                                                                                                                                                                                                                                                                                getConfig: (
                                                                                                                                                                                                                                                                                                key: string,
                                                                                                                                                                                                                                                                                                scope?: keyof typeof GitConfigScope,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                ) => Response<ConfigGetResult>;
                                                                                                                                                                                                                                                                                                • Gets the current value of a configuration property by it key, optionally specify the scope in which to run the command (omit / set to undefined to check in the complete overlaid configuration visible to the git process).

                                                                                                                                                                                                                                                                                                method getRemotes

                                                                                                                                                                                                                                                                                                getRemotes: {
                                                                                                                                                                                                                                                                                                (callback?: SimpleGitTaskCallback<RemoteWithoutRefs[]>): Response<
                                                                                                                                                                                                                                                                                                RemoteWithoutRefs[]
                                                                                                                                                                                                                                                                                                >;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                verbose?: false,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<RemoteWithoutRefs[], GitError>
                                                                                                                                                                                                                                                                                                ): Response<RemoteWithoutRefs[]>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                verbose: true,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<RemoteWithRefs[], GitError>
                                                                                                                                                                                                                                                                                                ): Response<RemoteWithRefs[]>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Gets the currently available remotes, setting the optional verbose argument to true includes additional detail on the remotes themselves.

                                                                                                                                                                                                                                                                                                method grep

                                                                                                                                                                                                                                                                                                grep: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                searchTerm: string | GitGrepQuery,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<GrepResult>
                                                                                                                                                                                                                                                                                                ): Response<GrepResult>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                searchTerm: string | GitGrepQuery,
                                                                                                                                                                                                                                                                                                options?: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<GrepResult, GitError>
                                                                                                                                                                                                                                                                                                ): Response<GrepResult>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Search for files matching the supplied search terms

                                                                                                                                                                                                                                                                                                method interpretTrailers

                                                                                                                                                                                                                                                                                                interpretTrailers: (
                                                                                                                                                                                                                                                                                                commitMessage: string | Buffer,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<Record<string, string>>
                                                                                                                                                                                                                                                                                                ) => Response<Record<string, string>>;
                                                                                                                                                                                                                                                                                                • Parses trailers from the supplied commit message. Omitting the message will throw a TaskConfigurationError.

                                                                                                                                                                                                                                                                                                method listConfig

                                                                                                                                                                                                                                                                                                listConfig: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                scope: keyof typeof GitConfigScope,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<ConfigListSummary>
                                                                                                                                                                                                                                                                                                ): Response<ConfigListSummary>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<ConfigListSummary, GitError>
                                                                                                                                                                                                                                                                                                ): Response<ConfigListSummary>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Configuration values visible to git in the current working directory

                                                                                                                                                                                                                                                                                                method listRemote

                                                                                                                                                                                                                                                                                                listRemote: (
                                                                                                                                                                                                                                                                                                args?: TaskOptions,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                ) => Response<string>;
                                                                                                                                                                                                                                                                                                • List remotes by running the ls-remote command with any number of arbitrary options in either array of object form.

                                                                                                                                                                                                                                                                                                method log

                                                                                                                                                                                                                                                                                                log: <T = DefaultLogFields>(
                                                                                                                                                                                                                                                                                                options?: TaskOptions | LogOptions<T>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<LogResult<T>>
                                                                                                                                                                                                                                                                                                ) => Response<LogResult<T>>;
                                                                                                                                                                                                                                                                                                • Show commit logs from HEAD to the first commit. If provided between options.from and options.to tags or branch.

                                                                                                                                                                                                                                                                                                  You can provide options.file, which is the path to a file in your repository. Then only this file will be considered.

                                                                                                                                                                                                                                                                                                  To use a custom splitter in the log format, set options.splitter to be the string the log should be split on.

                                                                                                                                                                                                                                                                                                  By default the following fields will be part of the result: hash: full commit hash date: author date, ISO 8601-like format message: subject + ref names, like the --decorate option of git-log author_name: author name author_email: author mail You can specify options.format to be an mapping from key to a format option like %H (for commit hash). The fields specified in options.format will be the fields in the result.

                                                                                                                                                                                                                                                                                                  Options can also be supplied as a standard options object for adding custom properties supported by the git log command. For any other set of options, supply options as an array of strings to be appended to the git log command.

                                                                                                                                                                                                                                                                                                  Returns

                                                                                                                                                                                                                                                                                                  Response

                                                                                                                                                                                                                                                                                                  See Also

                                                                                                                                                                                                                                                                                                  • https://git-scm.com/docs/git-log

                                                                                                                                                                                                                                                                                                method mirror

                                                                                                                                                                                                                                                                                                mirror: (
                                                                                                                                                                                                                                                                                                repoPath: string,
                                                                                                                                                                                                                                                                                                localPath: string,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                ) => Response<string>;
                                                                                                                                                                                                                                                                                                • Mirror a git repo

                                                                                                                                                                                                                                                                                                  Equivalent to git.clone(repoPath, localPath, ['--mirror']), clone allows for additional task options.

                                                                                                                                                                                                                                                                                                method mv

                                                                                                                                                                                                                                                                                                mv: (
                                                                                                                                                                                                                                                                                                from: string | string[],
                                                                                                                                                                                                                                                                                                to: string,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<MoveSummary>
                                                                                                                                                                                                                                                                                                ) => Response<MoveSummary>;
                                                                                                                                                                                                                                                                                                • Moves one or more files to a new destination.

                                                                                                                                                                                                                                                                                                  See Also

                                                                                                                                                                                                                                                                                                  • https://git-scm.com/docs/git-mv

                                                                                                                                                                                                                                                                                                method pull

                                                                                                                                                                                                                                                                                                pull: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                remote?: string,
                                                                                                                                                                                                                                                                                                branch?: string,
                                                                                                                                                                                                                                                                                                options?: TaskOptions,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<PullResult>
                                                                                                                                                                                                                                                                                                ): Response<PullResult>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                options?: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<PullResult, GitError>
                                                                                                                                                                                                                                                                                                ): Response<PullResult>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<PullResult, GitError>
                                                                                                                                                                                                                                                                                                ): Response<PullResult>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Fetch from and integrate with another repository or a local branch. In the case that the git pull fails with a recognised fatal error, the exception thrown by this function will be a GitResponseError<PullFailedResult>.

                                                                                                                                                                                                                                                                                                method pushTags

                                                                                                                                                                                                                                                                                                pushTags: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                remote: string,
                                                                                                                                                                                                                                                                                                options?: TaskOptions,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<PushResult>
                                                                                                                                                                                                                                                                                                ): Response<PushResult>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                options?: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<PushResult, GitError>
                                                                                                                                                                                                                                                                                                ): Response<PushResult>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<PushResult, GitError>
                                                                                                                                                                                                                                                                                                ): Response<PushResult>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Pushes the current tag changes to a remote which can be either a URL or named remote. When not specified uses the default configured remote spec.

                                                                                                                                                                                                                                                                                                method raw

                                                                                                                                                                                                                                                                                                raw: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                commands: string | string[] | TaskOptions,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                options: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (...commands: string[]): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                a: string,
                                                                                                                                                                                                                                                                                                options: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                a: string,
                                                                                                                                                                                                                                                                                                b: string,
                                                                                                                                                                                                                                                                                                options: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                a: string,
                                                                                                                                                                                                                                                                                                b: string,
                                                                                                                                                                                                                                                                                                c: string,
                                                                                                                                                                                                                                                                                                options: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                a: string,
                                                                                                                                                                                                                                                                                                b: string,
                                                                                                                                                                                                                                                                                                c: string,
                                                                                                                                                                                                                                                                                                d: string,
                                                                                                                                                                                                                                                                                                options: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                a: string,
                                                                                                                                                                                                                                                                                                b: string,
                                                                                                                                                                                                                                                                                                c: string,
                                                                                                                                                                                                                                                                                                d: string,
                                                                                                                                                                                                                                                                                                e: string,
                                                                                                                                                                                                                                                                                                options: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                a: string,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                a: string,
                                                                                                                                                                                                                                                                                                b: string,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                a: string,
                                                                                                                                                                                                                                                                                                b: string,
                                                                                                                                                                                                                                                                                                c: string,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                a: string,
                                                                                                                                                                                                                                                                                                b: string,
                                                                                                                                                                                                                                                                                                c: string,
                                                                                                                                                                                                                                                                                                d: string,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                a: string,
                                                                                                                                                                                                                                                                                                b: string,
                                                                                                                                                                                                                                                                                                c: string,
                                                                                                                                                                                                                                                                                                d: string,
                                                                                                                                                                                                                                                                                                e: string,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Executes any command against the git binary.

                                                                                                                                                                                                                                                                                                method rebase

                                                                                                                                                                                                                                                                                                rebase: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                options?: TaskOptions,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (callback?: SimpleGitTaskCallback<string, GitError>): Response<string>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Rebases the current working copy. Options can be supplied either as an array of string parameters to be sent to the git rebase command, or a standard options object.

                                                                                                                                                                                                                                                                                                method remote

                                                                                                                                                                                                                                                                                                remote: (
                                                                                                                                                                                                                                                                                                options: string[],
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<void | string>
                                                                                                                                                                                                                                                                                                ) => Response<void | string>;
                                                                                                                                                                                                                                                                                                • Call any git remote function with arguments passed as an array of strings.

                                                                                                                                                                                                                                                                                                method removeRemote

                                                                                                                                                                                                                                                                                                removeRemote: (
                                                                                                                                                                                                                                                                                                remoteName: string,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<void>
                                                                                                                                                                                                                                                                                                ) => Response<void>;
                                                                                                                                                                                                                                                                                                • Removes an entry from the list of remotes.

                                                                                                                                                                                                                                                                                                  - remoteName Name of the repository - eg "upstream"

                                                                                                                                                                                                                                                                                                method reset

                                                                                                                                                                                                                                                                                                reset: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                mode: ResetMode,
                                                                                                                                                                                                                                                                                                options?: TaskOptions<ResetOptions>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                mode: ResetMode,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                options?: TaskOptions<ResetOptions>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Reset a repo. Called without arguments this is a soft reset for the whole repo, for explicitly setting the reset mode, supply the first argument as one of the supported reset modes.

                                                                                                                                                                                                                                                                                                  Trailing options argument can be either a string array, or an extension of the ResetOptions, use this argument for supplying arbitrary additional arguments, such as restricting the pathspec.

                                                                                                                                                                                                                                                                                                  // equivalent to each other
                                                                                                                                                                                                                                                                                                  simpleGit().reset(ResetMode.HARD, ['--', 'my-file.txt']);
                                                                                                                                                                                                                                                                                                  simpleGit().reset(['--hard', '--', 'my-file.txt']);
                                                                                                                                                                                                                                                                                                  simpleGit().reset(ResetMode.HARD, {'--': null, 'my-file.txt': null});
                                                                                                                                                                                                                                                                                                  simpleGit().reset({'--hard': null, '--': null, 'my-file.txt': null});

                                                                                                                                                                                                                                                                                                method revert

                                                                                                                                                                                                                                                                                                revert: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                commit: String,
                                                                                                                                                                                                                                                                                                options?: TaskOptions,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<void>
                                                                                                                                                                                                                                                                                                ): Response<void>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                commit: String,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<void, GitError>
                                                                                                                                                                                                                                                                                                ): Response<void>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Revert one or more commits in the local working copy

                                                                                                                                                                                                                                                                                                  - commit The commit to revert. Can be any hash, offset (eg: HEAD~2) or range (eg: master~5..master~2)

                                                                                                                                                                                                                                                                                                method revparse

                                                                                                                                                                                                                                                                                                revparse: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                option: string,
                                                                                                                                                                                                                                                                                                options?: TaskOptions,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                options?: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Passes the supplied options to git rev-parse and returns the string response. Options can be either a string array or Options object of options compatible with the [rev-parse](https://git-scm.com/docs/git-rev-parse)

                                                                                                                                                                                                                                                                                                  Example uses of rev-parse include converting friendly commit references (ie: branch names) to SHA1 hashes and retrieving meta details about the current repo (eg: the root directory, and whether it was created as a bare repo).

                                                                                                                                                                                                                                                                                                method rm

                                                                                                                                                                                                                                                                                                rm: (
                                                                                                                                                                                                                                                                                                paths: string | string[],
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<void>
                                                                                                                                                                                                                                                                                                ) => Response<void>;
                                                                                                                                                                                                                                                                                                • Removes the named files from source control.

                                                                                                                                                                                                                                                                                                method rmKeepLocal

                                                                                                                                                                                                                                                                                                rmKeepLocal: (
                                                                                                                                                                                                                                                                                                paths: string | string[],
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<void>
                                                                                                                                                                                                                                                                                                ) => Response<void>;
                                                                                                                                                                                                                                                                                                • Removes the named files from source control but keeps them on disk rather than deleting them entirely. To completely remove the files, use rm.

                                                                                                                                                                                                                                                                                                method show

                                                                                                                                                                                                                                                                                                show: {
                                                                                                                                                                                                                                                                                                (
                                                                                                                                                                                                                                                                                                option: string | TaskOptions,
                                                                                                                                                                                                                                                                                                callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                ): Response<string>;
                                                                                                                                                                                                                                                                                                (callback?: SimpleGitTaskCallback<string, GitError>): Response<string>;
                                                                                                                                                                                                                                                                                                };
                                                                                                                                                                                                                                                                                                • Show various types of objects, for example the file at a certain commit

                                                                                                                                                                                                                                                                                                method showBuffer

                                                                                                                                                                                                                                                                                                showBuffer: (option: string | TaskOptions) => Response<Buffer>;

                                                                                                                                                                                                                                                                                                  method stashList

                                                                                                                                                                                                                                                                                                  stashList: {
                                                                                                                                                                                                                                                                                                  (
                                                                                                                                                                                                                                                                                                  options?: TaskOptions,
                                                                                                                                                                                                                                                                                                  callback?: SimpleGitTaskCallback<LogResult>
                                                                                                                                                                                                                                                                                                  ): Response<LogResult>;
                                                                                                                                                                                                                                                                                                  (
                                                                                                                                                                                                                                                                                                  callback?: SimpleGitTaskCallback<LogResult<DefaultLogFields>, GitError>
                                                                                                                                                                                                                                                                                                  ): Response<LogResult<DefaultLogFields>>;
                                                                                                                                                                                                                                                                                                  };
                                                                                                                                                                                                                                                                                                  • List the stash(s) of the local repo

                                                                                                                                                                                                                                                                                                  method subModule

                                                                                                                                                                                                                                                                                                  subModule: (
                                                                                                                                                                                                                                                                                                  options?: TaskOptions,
                                                                                                                                                                                                                                                                                                  callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                  ) => Response<string>;
                                                                                                                                                                                                                                                                                                  • Call any git submodule function with arguments passed as an array of strings.

                                                                                                                                                                                                                                                                                                  method submoduleAdd

                                                                                                                                                                                                                                                                                                  submoduleAdd: (
                                                                                                                                                                                                                                                                                                  repo: string,
                                                                                                                                                                                                                                                                                                  path: string,
                                                                                                                                                                                                                                                                                                  callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                  ) => Response<string>;
                                                                                                                                                                                                                                                                                                  • Add a submodule

                                                                                                                                                                                                                                                                                                  method submoduleInit

                                                                                                                                                                                                                                                                                                  submoduleInit: {
                                                                                                                                                                                                                                                                                                  (
                                                                                                                                                                                                                                                                                                  moduleName: string,
                                                                                                                                                                                                                                                                                                  options?: TaskOptions,
                                                                                                                                                                                                                                                                                                  callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                  ): Response<string>;
                                                                                                                                                                                                                                                                                                  (
                                                                                                                                                                                                                                                                                                  moduleName: string,
                                                                                                                                                                                                                                                                                                  callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                  ): Response<string>;
                                                                                                                                                                                                                                                                                                  (
                                                                                                                                                                                                                                                                                                  options?: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                  callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                  ): Response<string>;
                                                                                                                                                                                                                                                                                                  (callback?: SimpleGitTaskCallback<string, GitError>): Response<string>;
                                                                                                                                                                                                                                                                                                  };
                                                                                                                                                                                                                                                                                                  • Initialise submodules

                                                                                                                                                                                                                                                                                                  method submoduleUpdate

                                                                                                                                                                                                                                                                                                  submoduleUpdate: {
                                                                                                                                                                                                                                                                                                  (
                                                                                                                                                                                                                                                                                                  moduleName: string,
                                                                                                                                                                                                                                                                                                  options?: TaskOptions,
                                                                                                                                                                                                                                                                                                  callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                  ): Response<string>;
                                                                                                                                                                                                                                                                                                  (
                                                                                                                                                                                                                                                                                                  moduleName: string,
                                                                                                                                                                                                                                                                                                  callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                  ): Response<string>;
                                                                                                                                                                                                                                                                                                  (
                                                                                                                                                                                                                                                                                                  options?: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                  callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                  ): Response<string>;
                                                                                                                                                                                                                                                                                                  (callback?: SimpleGitTaskCallback<string, GitError>): Response<string>;
                                                                                                                                                                                                                                                                                                  };
                                                                                                                                                                                                                                                                                                  • Update submodules

                                                                                                                                                                                                                                                                                                  method tag

                                                                                                                                                                                                                                                                                                  tag: (
                                                                                                                                                                                                                                                                                                  options?: TaskOptions,
                                                                                                                                                                                                                                                                                                  callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                  ) => Response<string>;
                                                                                                                                                                                                                                                                                                  • List all tags. When using git 2.7.0 or above, include an options object with "--sort": "property-name" to sort the tags by that property instead of using the default semantic versioning sort.

                                                                                                                                                                                                                                                                                                    Note, supplying this option when it is not supported by your Git version will cause the operation to fail.

                                                                                                                                                                                                                                                                                                  method tags

                                                                                                                                                                                                                                                                                                  tags: {
                                                                                                                                                                                                                                                                                                  (
                                                                                                                                                                                                                                                                                                  options?: TaskOptions,
                                                                                                                                                                                                                                                                                                  callback?: SimpleGitTaskCallback<TagResult>
                                                                                                                                                                                                                                                                                                  ): Response<TagResult>;
                                                                                                                                                                                                                                                                                                  (callback?: SimpleGitTaskCallback<TagResult, GitError>): Response<TagResult>;
                                                                                                                                                                                                                                                                                                  };
                                                                                                                                                                                                                                                                                                  • Gets a list of tagged versions.

                                                                                                                                                                                                                                                                                                  method updateServerInfo

                                                                                                                                                                                                                                                                                                  updateServerInfo: (callback?: SimpleGitTaskCallback<string>) => Response<string>;
                                                                                                                                                                                                                                                                                                  • Updates repository server info

                                                                                                                                                                                                                                                                                                  method version

                                                                                                                                                                                                                                                                                                  version: (
                                                                                                                                                                                                                                                                                                  callback?: SimpleGitTaskCallback<VersionResult>
                                                                                                                                                                                                                                                                                                  ) => Response<VersionResult>;
                                                                                                                                                                                                                                                                                                  • Retrieves git version information, including whether git is installed on the PATH

                                                                                                                                                                                                                                                                                                  interface SimpleGitBase

                                                                                                                                                                                                                                                                                                  interface SimpleGitBase {}

                                                                                                                                                                                                                                                                                                    method add

                                                                                                                                                                                                                                                                                                    add: (
                                                                                                                                                                                                                                                                                                    files: string | string[],
                                                                                                                                                                                                                                                                                                    callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                    ) => Response<string>;
                                                                                                                                                                                                                                                                                                    • Adds one or more files to source control

                                                                                                                                                                                                                                                                                                    method cwd

                                                                                                                                                                                                                                                                                                    cwd: {
                                                                                                                                                                                                                                                                                                    (
                                                                                                                                                                                                                                                                                                    directory: { path: string; root?: boolean },
                                                                                                                                                                                                                                                                                                    callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                    ): Response<string>;
                                                                                                                                                                                                                                                                                                    <path extends string>(
                                                                                                                                                                                                                                                                                                    directory: path,
                                                                                                                                                                                                                                                                                                    callback?: SimpleGitTaskCallback<path, GitError>
                                                                                                                                                                                                                                                                                                    ): Response<path>;
                                                                                                                                                                                                                                                                                                    };
                                                                                                                                                                                                                                                                                                    • Sets the working directory of the subsequent commands.

                                                                                                                                                                                                                                                                                                    method hashObject

                                                                                                                                                                                                                                                                                                    hashObject: {
                                                                                                                                                                                                                                                                                                    (path: string, callback?: SimpleGitTaskCallback): Response<string>;
                                                                                                                                                                                                                                                                                                    (
                                                                                                                                                                                                                                                                                                    path: string,
                                                                                                                                                                                                                                                                                                    write?: boolean,
                                                                                                                                                                                                                                                                                                    callback?: SimpleGitTaskCallback<string, GitError>
                                                                                                                                                                                                                                                                                                    ): Response<string>;
                                                                                                                                                                                                                                                                                                    };
                                                                                                                                                                                                                                                                                                    • Compute object ID from a file

                                                                                                                                                                                                                                                                                                    method init

                                                                                                                                                                                                                                                                                                    init: {
                                                                                                                                                                                                                                                                                                    (
                                                                                                                                                                                                                                                                                                    bare: boolean,
                                                                                                                                                                                                                                                                                                    options?: TaskOptions,
                                                                                                                                                                                                                                                                                                    callback?: SimpleGitTaskCallback<InitResult>
                                                                                                                                                                                                                                                                                                    ): Response<InitResult>;
                                                                                                                                                                                                                                                                                                    (
                                                                                                                                                                                                                                                                                                    bare: boolean,
                                                                                                                                                                                                                                                                                                    callback?: SimpleGitTaskCallback<InitResult, GitError>
                                                                                                                                                                                                                                                                                                    ): Response<InitResult>;
                                                                                                                                                                                                                                                                                                    (
                                                                                                                                                                                                                                                                                                    options?: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                    callback?: SimpleGitTaskCallback<InitResult, GitError>
                                                                                                                                                                                                                                                                                                    ): Response<InitResult>;
                                                                                                                                                                                                                                                                                                    (
                                                                                                                                                                                                                                                                                                    callback?: SimpleGitTaskCallback<InitResult, GitError>
                                                                                                                                                                                                                                                                                                    ): Response<InitResult>;
                                                                                                                                                                                                                                                                                                    };
                                                                                                                                                                                                                                                                                                    • Initialize a git repo

                                                                                                                                                                                                                                                                                                    method merge

                                                                                                                                                                                                                                                                                                    merge: (
                                                                                                                                                                                                                                                                                                    options: TaskOptions,
                                                                                                                                                                                                                                                                                                    callback?: SimpleGitTaskCallback<MergeResult>
                                                                                                                                                                                                                                                                                                    ) => Response<MergeResult>;
                                                                                                                                                                                                                                                                                                    • Runs a merge, options can be either an array of arguments supported by the [git merge](https://git-scm.com/docs/git-merge) or an options object.

                                                                                                                                                                                                                                                                                                      Conflicts during the merge result in an error response, the response type whether it was an error or success will be a MergeSummary instance. When successful, the MergeSummary has all detail from a the PullSummary

                                                                                                                                                                                                                                                                                                      See Also

                                                                                                                                                                                                                                                                                                      • https://github.com/steveukx/git-js/blob/master/src/responses/MergeSummary.js

                                                                                                                                                                                                                                                                                                      • https://github.com/steveukx/git-js/blob/master/src/responses/PullSummary.js

                                                                                                                                                                                                                                                                                                    method mergeFromTo

                                                                                                                                                                                                                                                                                                    mergeFromTo: {
                                                                                                                                                                                                                                                                                                    <E extends GitError>(
                                                                                                                                                                                                                                                                                                    remote: string,
                                                                                                                                                                                                                                                                                                    branch: string,
                                                                                                                                                                                                                                                                                                    options?: TaskOptions,
                                                                                                                                                                                                                                                                                                    callback?: SimpleGitTaskCallback<MergeResult, E>
                                                                                                                                                                                                                                                                                                    ): Response<MergeResult>;
                                                                                                                                                                                                                                                                                                    <E extends GitError>(
                                                                                                                                                                                                                                                                                                    remote: string,
                                                                                                                                                                                                                                                                                                    branch: string,
                                                                                                                                                                                                                                                                                                    callback?: SimpleGitTaskCallback<MergeResult, E>
                                                                                                                                                                                                                                                                                                    ): Response<MergeResult>;
                                                                                                                                                                                                                                                                                                    };
                                                                                                                                                                                                                                                                                                    • Merges from one branch to another, equivalent to running git merge ${remote} ${branch}, the options argument can either be an array of additional parameters to pass to the command or null / omitted to be ignored.

                                                                                                                                                                                                                                                                                                    method outputHandler

                                                                                                                                                                                                                                                                                                    outputHandler: (handler: outputHandler | void) => this;
                                                                                                                                                                                                                                                                                                    • Sets a handler function to be called whenever a new child process is created, the handler function will be called with the name of the command being run and the stdout & stderr streams used by the ChildProcess.

                                                                                                                                                                                                                                                                                                      Example 1

                                                                                                                                                                                                                                                                                                      require('simple-git') .outputHandler(function (command, stdout, stderr) { stdout.pipe(process.stdout); }) .checkout('https://github.com/user/repo.git');

                                                                                                                                                                                                                                                                                                      See Also

                                                                                                                                                                                                                                                                                                      • https://nodejs.org/api/child_process.html#child_process_class_childprocess

                                                                                                                                                                                                                                                                                                      • https://nodejs.org/api/stream.html#stream_class_stream_readable

                                                                                                                                                                                                                                                                                                    method push

                                                                                                                                                                                                                                                                                                    push: {
                                                                                                                                                                                                                                                                                                    (
                                                                                                                                                                                                                                                                                                    remote?: string,
                                                                                                                                                                                                                                                                                                    branch?: string,
                                                                                                                                                                                                                                                                                                    options?: TaskOptions,
                                                                                                                                                                                                                                                                                                    callback?: SimpleGitTaskCallback<PushResult>
                                                                                                                                                                                                                                                                                                    ): Response<PushResult>;
                                                                                                                                                                                                                                                                                                    (
                                                                                                                                                                                                                                                                                                    options?: TaskOptions<Options>,
                                                                                                                                                                                                                                                                                                    callback?: SimpleGitTaskCallback<PushResult, GitError>
                                                                                                                                                                                                                                                                                                    ): Response<PushResult>;
                                                                                                                                                                                                                                                                                                    (
                                                                                                                                                                                                                                                                                                    callback?: SimpleGitTaskCallback<PushResult, GitError>
                                                                                                                                                                                                                                                                                                    ): Response<PushResult>;
                                                                                                                                                                                                                                                                                                    };
                                                                                                                                                                                                                                                                                                    • Pushes the current committed changes to a remote, optionally specify the names of the remote and branch to use when pushing. Supply multiple options as an array of strings in the first argument - see examples below.

                                                                                                                                                                                                                                                                                                    method stash

                                                                                                                                                                                                                                                                                                    stash: {
                                                                                                                                                                                                                                                                                                    (
                                                                                                                                                                                                                                                                                                    options?: TaskOptions,
                                                                                                                                                                                                                                                                                                    callback?: SimpleGitTaskCallback<string>
                                                                                                                                                                                                                                                                                                    ): Response<string>;
                                                                                                                                                                                                                                                                                                    (callback?: SimpleGitTaskCallback<string, GitError>): Response<string>;
                                                                                                                                                                                                                                                                                                    };
                                                                                                                                                                                                                                                                                                    • Stash the local repo

                                                                                                                                                                                                                                                                                                    method status

                                                                                                                                                                                                                                                                                                    status: {
                                                                                                                                                                                                                                                                                                    (
                                                                                                                                                                                                                                                                                                    options?: TaskOptions,
                                                                                                                                                                                                                                                                                                    callback?: SimpleGitTaskCallback<StatusResult>
                                                                                                                                                                                                                                                                                                    ): Response<StatusResult>;
                                                                                                                                                                                                                                                                                                    (
                                                                                                                                                                                                                                                                                                    callback?: SimpleGitTaskCallback<StatusResult, GitError>
                                                                                                                                                                                                                                                                                                    ): Response<StatusResult>;
                                                                                                                                                                                                                                                                                                    };
                                                                                                                                                                                                                                                                                                    • Show the working tree status.

                                                                                                                                                                                                                                                                                                    interface SimpleGitFactory

                                                                                                                                                                                                                                                                                                    interface SimpleGitFactory {}

                                                                                                                                                                                                                                                                                                      call signature

                                                                                                                                                                                                                                                                                                      (baseDir?: string, options?: Partial<SimpleGitOptions>): SimpleGit;

                                                                                                                                                                                                                                                                                                        call signature

                                                                                                                                                                                                                                                                                                        (baseDir: string): SimpleGit;

                                                                                                                                                                                                                                                                                                          call signature

                                                                                                                                                                                                                                                                                                          (options: Partial<SimpleGitOptions>): SimpleGit;

                                                                                                                                                                                                                                                                                                            interface SimpleGitOptions

                                                                                                                                                                                                                                                                                                            interface SimpleGitOptions extends Partial<SimpleGitPluginConfig> {}
                                                                                                                                                                                                                                                                                                            • Optional configuration settings to be passed to the simpleGit builder.

                                                                                                                                                                                                                                                                                                            property baseDir

                                                                                                                                                                                                                                                                                                            baseDir: string;
                                                                                                                                                                                                                                                                                                            • Base directory for all tasks run through this simple-git instance

                                                                                                                                                                                                                                                                                                            property config

                                                                                                                                                                                                                                                                                                            config: string[];
                                                                                                                                                                                                                                                                                                            • Per-command configuration parameters to be passed with the -c switch to git

                                                                                                                                                                                                                                                                                                            property maxConcurrentProcesses

                                                                                                                                                                                                                                                                                                            maxConcurrentProcesses: number;
                                                                                                                                                                                                                                                                                                            • Limit for the number of child processes that will be spawned concurrently from a simple-git instance

                                                                                                                                                                                                                                                                                                            property trimmed

                                                                                                                                                                                                                                                                                                            trimmed: boolean;
                                                                                                                                                                                                                                                                                                            • Enable trimming of trailing white-space in git.raw

                                                                                                                                                                                                                                                                                                            interface SimpleGitProgressEvent

                                                                                                                                                                                                                                                                                                            interface SimpleGitProgressEvent {}
                                                                                                                                                                                                                                                                                                            • The event data emitted to the progress handler whenever progress detail is received.

                                                                                                                                                                                                                                                                                                            property method

                                                                                                                                                                                                                                                                                                            method: string;
                                                                                                                                                                                                                                                                                                            • The underlying method called - push, pull etc

                                                                                                                                                                                                                                                                                                            property processed

                                                                                                                                                                                                                                                                                                            processed: number;
                                                                                                                                                                                                                                                                                                            • The number of items processed so far

                                                                                                                                                                                                                                                                                                            property progress

                                                                                                                                                                                                                                                                                                            progress: number;
                                                                                                                                                                                                                                                                                                            • The percent progressed as a number 0 - 100

                                                                                                                                                                                                                                                                                                            property stage

                                                                                                                                                                                                                                                                                                            stage:
                                                                                                                                                                                                                                                                                                            | 'compressing'
                                                                                                                                                                                                                                                                                                            | 'counting'
                                                                                                                                                                                                                                                                                                            | 'receiving'
                                                                                                                                                                                                                                                                                                            | 'resolving'
                                                                                                                                                                                                                                                                                                            | 'unknown'
                                                                                                                                                                                                                                                                                                            | 'writing'
                                                                                                                                                                                                                                                                                                            | string;
                                                                                                                                                                                                                                                                                                            • The type of progress being reported, note that any one task may emit many stages - for example git clone emits both receiving and resolving

                                                                                                                                                                                                                                                                                                            property total

                                                                                                                                                                                                                                                                                                            total: number;
                                                                                                                                                                                                                                                                                                            • The total number of items to be processed

                                                                                                                                                                                                                                                                                                            interface StatusResult

                                                                                                                                                                                                                                                                                                            interface StatusResult {}
                                                                                                                                                                                                                                                                                                            • The StatusResult is returned for calls to git.status(), represents the state of the working directory.

                                                                                                                                                                                                                                                                                                            property ahead

                                                                                                                                                                                                                                                                                                            ahead: number;
                                                                                                                                                                                                                                                                                                            • Number of commits ahead of the tracked branch

                                                                                                                                                                                                                                                                                                            property behind

                                                                                                                                                                                                                                                                                                            behind: number;
                                                                                                                                                                                                                                                                                                            • Number of commits behind the tracked branch

                                                                                                                                                                                                                                                                                                            property conflicted

                                                                                                                                                                                                                                                                                                            conflicted: string[];

                                                                                                                                                                                                                                                                                                              property created

                                                                                                                                                                                                                                                                                                              created: string[];

                                                                                                                                                                                                                                                                                                                property current

                                                                                                                                                                                                                                                                                                                current: string | null;
                                                                                                                                                                                                                                                                                                                • Name of the current branch

                                                                                                                                                                                                                                                                                                                property deleted

                                                                                                                                                                                                                                                                                                                deleted: string[];

                                                                                                                                                                                                                                                                                                                  property detached

                                                                                                                                                                                                                                                                                                                  detached: boolean;
                                                                                                                                                                                                                                                                                                                  • Detached status of the working copy, for more detail of what the working branch is detached from use git.branch()

                                                                                                                                                                                                                                                                                                                  property files

                                                                                                                                                                                                                                                                                                                  files: FileStatusResult[];
                                                                                                                                                                                                                                                                                                                  • All files represented as an array of objects containing the path and status in index and in the working_dir.

                                                                                                                                                                                                                                                                                                                  property ignored

                                                                                                                                                                                                                                                                                                                  ignored?: string[];
                                                                                                                                                                                                                                                                                                                  • Ignored files are not listed by default, add --ignored to the task options in order to see this array of ignored files/paths.

                                                                                                                                                                                                                                                                                                                    Note: ignored files will not be added to the files array, and will not be included in the isClean() calculation.

                                                                                                                                                                                                                                                                                                                  property modified

                                                                                                                                                                                                                                                                                                                  modified: string[];

                                                                                                                                                                                                                                                                                                                    property not_added

                                                                                                                                                                                                                                                                                                                    not_added: string[];

                                                                                                                                                                                                                                                                                                                      property renamed

                                                                                                                                                                                                                                                                                                                      renamed: StatusResultRenamed[];

                                                                                                                                                                                                                                                                                                                        property staged

                                                                                                                                                                                                                                                                                                                        staged: string[];

                                                                                                                                                                                                                                                                                                                          property tracking

                                                                                                                                                                                                                                                                                                                          tracking: string | null;
                                                                                                                                                                                                                                                                                                                          • Name of the branch being tracked

                                                                                                                                                                                                                                                                                                                          method isClean

                                                                                                                                                                                                                                                                                                                          isClean: () => boolean;
                                                                                                                                                                                                                                                                                                                          • Gets whether this represents a clean working branch.

                                                                                                                                                                                                                                                                                                                          interface StatusResultRenamed

                                                                                                                                                                                                                                                                                                                          interface StatusResultRenamed {}
                                                                                                                                                                                                                                                                                                                          • Represents file name changes in a StatusResult

                                                                                                                                                                                                                                                                                                                          property from

                                                                                                                                                                                                                                                                                                                          from: string;

                                                                                                                                                                                                                                                                                                                            property to

                                                                                                                                                                                                                                                                                                                            to: string;

                                                                                                                                                                                                                                                                                                                              interface TagResult

                                                                                                                                                                                                                                                                                                                              interface TagResult {}
                                                                                                                                                                                                                                                                                                                              • Response retrieved when using the git.tags method

                                                                                                                                                                                                                                                                                                                              property all

                                                                                                                                                                                                                                                                                                                              all: string[];
                                                                                                                                                                                                                                                                                                                              • All tag names

                                                                                                                                                                                                                                                                                                                              property latest

                                                                                                                                                                                                                                                                                                                              latest: string | undefined;
                                                                                                                                                                                                                                                                                                                              • The semver latest tag name or undefined when no tags are named in the response

                                                                                                                                                                                                                                                                                                                              interface VersionResult

                                                                                                                                                                                                                                                                                                                              interface VersionResult {}

                                                                                                                                                                                                                                                                                                                                property agent

                                                                                                                                                                                                                                                                                                                                agent: string;

                                                                                                                                                                                                                                                                                                                                  property installed

                                                                                                                                                                                                                                                                                                                                  installed: boolean;

                                                                                                                                                                                                                                                                                                                                    property major

                                                                                                                                                                                                                                                                                                                                    major: number;

                                                                                                                                                                                                                                                                                                                                      property minor

                                                                                                                                                                                                                                                                                                                                      minor: number;

                                                                                                                                                                                                                                                                                                                                        property patch

                                                                                                                                                                                                                                                                                                                                        patch: number | string;

                                                                                                                                                                                                                                                                                                                                          Enums

                                                                                                                                                                                                                                                                                                                                          enum CheckRepoActions

                                                                                                                                                                                                                                                                                                                                          enum CheckRepoActions {
                                                                                                                                                                                                                                                                                                                                          BARE = 'bare',
                                                                                                                                                                                                                                                                                                                                          IN_TREE = 'tree',
                                                                                                                                                                                                                                                                                                                                          IS_REPO_ROOT = 'root',
                                                                                                                                                                                                                                                                                                                                          }

                                                                                                                                                                                                                                                                                                                                            member BARE

                                                                                                                                                                                                                                                                                                                                            BARE = 'bare'

                                                                                                                                                                                                                                                                                                                                              member IN_TREE

                                                                                                                                                                                                                                                                                                                                              IN_TREE = 'tree'

                                                                                                                                                                                                                                                                                                                                                member IS_REPO_ROOT

                                                                                                                                                                                                                                                                                                                                                IS_REPO_ROOT = 'root'

                                                                                                                                                                                                                                                                                                                                                  enum CleanOptions

                                                                                                                                                                                                                                                                                                                                                  enum CleanOptions {
                                                                                                                                                                                                                                                                                                                                                  DRY_RUN = 'n',
                                                                                                                                                                                                                                                                                                                                                  FORCE = 'f',
                                                                                                                                                                                                                                                                                                                                                  IGNORED_INCLUDED = 'x',
                                                                                                                                                                                                                                                                                                                                                  IGNORED_ONLY = 'X',
                                                                                                                                                                                                                                                                                                                                                  EXCLUDING = 'e',
                                                                                                                                                                                                                                                                                                                                                  QUIET = 'q',
                                                                                                                                                                                                                                                                                                                                                  RECURSIVE = 'd',
                                                                                                                                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                                                                                                                                                  • All supported option switches available for use in a git.clean operation

                                                                                                                                                                                                                                                                                                                                                  member DRY_RUN

                                                                                                                                                                                                                                                                                                                                                  DRY_RUN = 'n'

                                                                                                                                                                                                                                                                                                                                                    member EXCLUDING

                                                                                                                                                                                                                                                                                                                                                    EXCLUDING = 'e'

                                                                                                                                                                                                                                                                                                                                                      member FORCE

                                                                                                                                                                                                                                                                                                                                                      FORCE = 'f'

                                                                                                                                                                                                                                                                                                                                                        member IGNORED_INCLUDED

                                                                                                                                                                                                                                                                                                                                                        IGNORED_INCLUDED = 'x'

                                                                                                                                                                                                                                                                                                                                                          member IGNORED_ONLY

                                                                                                                                                                                                                                                                                                                                                          IGNORED_ONLY = 'X'

                                                                                                                                                                                                                                                                                                                                                            member QUIET

                                                                                                                                                                                                                                                                                                                                                            QUIET = 'q'

                                                                                                                                                                                                                                                                                                                                                              member RECURSIVE

                                                                                                                                                                                                                                                                                                                                                              RECURSIVE = 'd'

                                                                                                                                                                                                                                                                                                                                                                enum DiffNameStatus

                                                                                                                                                                                                                                                                                                                                                                enum DiffNameStatus {
                                                                                                                                                                                                                                                                                                                                                                ADDED = 'A',
                                                                                                                                                                                                                                                                                                                                                                COPIED = 'C',
                                                                                                                                                                                                                                                                                                                                                                DELETED = 'D',
                                                                                                                                                                                                                                                                                                                                                                MODIFIED = 'M',
                                                                                                                                                                                                                                                                                                                                                                RENAMED = 'R',
                                                                                                                                                                                                                                                                                                                                                                CHANGED = 'T',
                                                                                                                                                                                                                                                                                                                                                                UNMERGED = 'U',
                                                                                                                                                                                                                                                                                                                                                                UNKNOWN = 'X',
                                                                                                                                                                                                                                                                                                                                                                BROKEN = 'B',
                                                                                                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                                                                                                  member ADDED

                                                                                                                                                                                                                                                                                                                                                                  ADDED = 'A'

                                                                                                                                                                                                                                                                                                                                                                    member BROKEN

                                                                                                                                                                                                                                                                                                                                                                    BROKEN = 'B'

                                                                                                                                                                                                                                                                                                                                                                      member CHANGED

                                                                                                                                                                                                                                                                                                                                                                      CHANGED = 'T'

                                                                                                                                                                                                                                                                                                                                                                        member COPIED

                                                                                                                                                                                                                                                                                                                                                                        COPIED = 'C'

                                                                                                                                                                                                                                                                                                                                                                          member DELETED

                                                                                                                                                                                                                                                                                                                                                                          DELETED = 'D'

                                                                                                                                                                                                                                                                                                                                                                            member MODIFIED

                                                                                                                                                                                                                                                                                                                                                                            MODIFIED = 'M'

                                                                                                                                                                                                                                                                                                                                                                              member RENAMED

                                                                                                                                                                                                                                                                                                                                                                              RENAMED = 'R'

                                                                                                                                                                                                                                                                                                                                                                                member UNKNOWN

                                                                                                                                                                                                                                                                                                                                                                                UNKNOWN = 'X'

                                                                                                                                                                                                                                                                                                                                                                                  member UNMERGED

                                                                                                                                                                                                                                                                                                                                                                                  UNMERGED = 'U'

                                                                                                                                                                                                                                                                                                                                                                                    enum GitConfigScope

                                                                                                                                                                                                                                                                                                                                                                                    enum GitConfigScope {
                                                                                                                                                                                                                                                                                                                                                                                    system = 'system',
                                                                                                                                                                                                                                                                                                                                                                                    global = 'global',
                                                                                                                                                                                                                                                                                                                                                                                    local = 'local',
                                                                                                                                                                                                                                                                                                                                                                                    worktree = 'worktree',
                                                                                                                                                                                                                                                                                                                                                                                    }

                                                                                                                                                                                                                                                                                                                                                                                      member global

                                                                                                                                                                                                                                                                                                                                                                                      global = 'global'

                                                                                                                                                                                                                                                                                                                                                                                        member local

                                                                                                                                                                                                                                                                                                                                                                                        local = 'local'

                                                                                                                                                                                                                                                                                                                                                                                          member system

                                                                                                                                                                                                                                                                                                                                                                                          system = 'system'

                                                                                                                                                                                                                                                                                                                                                                                            member worktree

                                                                                                                                                                                                                                                                                                                                                                                            worktree = 'worktree'

                                                                                                                                                                                                                                                                                                                                                                                              enum ResetMode

                                                                                                                                                                                                                                                                                                                                                                                              enum ResetMode {
                                                                                                                                                                                                                                                                                                                                                                                              MIXED = 'mixed',
                                                                                                                                                                                                                                                                                                                                                                                              SOFT = 'soft',
                                                                                                                                                                                                                                                                                                                                                                                              HARD = 'hard',
                                                                                                                                                                                                                                                                                                                                                                                              MERGE = 'merge',
                                                                                                                                                                                                                                                                                                                                                                                              KEEP = 'keep',
                                                                                                                                                                                                                                                                                                                                                                                              }

                                                                                                                                                                                                                                                                                                                                                                                                member HARD

                                                                                                                                                                                                                                                                                                                                                                                                HARD = 'hard'

                                                                                                                                                                                                                                                                                                                                                                                                  member KEEP

                                                                                                                                                                                                                                                                                                                                                                                                  KEEP = 'keep'

                                                                                                                                                                                                                                                                                                                                                                                                    member MERGE

                                                                                                                                                                                                                                                                                                                                                                                                    MERGE = 'merge'

                                                                                                                                                                                                                                                                                                                                                                                                      member MIXED

                                                                                                                                                                                                                                                                                                                                                                                                      MIXED = 'mixed'

                                                                                                                                                                                                                                                                                                                                                                                                        member SOFT

                                                                                                                                                                                                                                                                                                                                                                                                        SOFT = 'soft'

                                                                                                                                                                                                                                                                                                                                                                                                          Type Aliases

                                                                                                                                                                                                                                                                                                                                                                                                          type ApplyOptions

                                                                                                                                                                                                                                                                                                                                                                                                          type ApplyOptions = Options &
                                                                                                                                                                                                                                                                                                                                                                                                          OptionFlags<
                                                                                                                                                                                                                                                                                                                                                                                                          | '--stat'
                                                                                                                                                                                                                                                                                                                                                                                                          | '--numstat'
                                                                                                                                                                                                                                                                                                                                                                                                          | '--summary'
                                                                                                                                                                                                                                                                                                                                                                                                          | '--check'
                                                                                                                                                                                                                                                                                                                                                                                                          | '--index'
                                                                                                                                                                                                                                                                                                                                                                                                          | '--intent-to-add'
                                                                                                                                                                                                                                                                                                                                                                                                          | '--3way'
                                                                                                                                                                                                                                                                                                                                                                                                          | '--apply'
                                                                                                                                                                                                                                                                                                                                                                                                          | '--no-add'
                                                                                                                                                                                                                                                                                                                                                                                                          | '-R'
                                                                                                                                                                                                                                                                                                                                                                                                          | '--reverse'
                                                                                                                                                                                                                                                                                                                                                                                                          | '--allow-binary-replacement'
                                                                                                                                                                                                                                                                                                                                                                                                          | '--binary'
                                                                                                                                                                                                                                                                                                                                                                                                          | '--reject'
                                                                                                                                                                                                                                                                                                                                                                                                          | '-z'
                                                                                                                                                                                                                                                                                                                                                                                                          | '--inaccurate-eof'
                                                                                                                                                                                                                                                                                                                                                                                                          | '--recount'
                                                                                                                                                                                                                                                                                                                                                                                                          | '--cached'
                                                                                                                                                                                                                                                                                                                                                                                                          | '--ignore-space-change'
                                                                                                                                                                                                                                                                                                                                                                                                          | '--ignore-whitespace'
                                                                                                                                                                                                                                                                                                                                                                                                          | '--verbose'
                                                                                                                                                                                                                                                                                                                                                                                                          | '--unsafe-paths'
                                                                                                                                                                                                                                                                                                                                                                                                          > &
                                                                                                                                                                                                                                                                                                                                                                                                          OptionFlags<'--whitespace', 'nowarn' | 'warn' | 'fix' | 'error' | 'error-all'> &
                                                                                                                                                                                                                                                                                                                                                                                                          OptionFlags<
                                                                                                                                                                                                                                                                                                                                                                                                          '--build-fake-ancestor' | '--exclude' | '--include' | '--directory',
                                                                                                                                                                                                                                                                                                                                                                                                          string
                                                                                                                                                                                                                                                                                                                                                                                                          > &
                                                                                                                                                                                                                                                                                                                                                                                                          OptionFlags<'-p' | '-C', number>;

                                                                                                                                                                                                                                                                                                                                                                                                            type BranchDeletionBatchSummary

                                                                                                                                                                                                                                                                                                                                                                                                            type BranchDeletionBatchSummary = BranchMultiDeleteResult;
                                                                                                                                                                                                                                                                                                                                                                                                            • Deprecated

                                                                                                                                                                                                                                                                                                                                                                                                              to aid consistent naming, please use BranchMultiDeleteResult instead of BranchDeletionBatchSummary.

                                                                                                                                                                                                                                                                                                                                                                                                            type BranchDeletionSummary

                                                                                                                                                                                                                                                                                                                                                                                                            type BranchDeletionSummary = BranchSingleDeleteResult;
                                                                                                                                                                                                                                                                                                                                                                                                            • Deprecated

                                                                                                                                                                                                                                                                                                                                                                                                              to aid consistent naming, please use BranchSingleDeleteResult instead of BranchDeletionSummary.

                                                                                                                                                                                                                                                                                                                                                                                                            type BranchSingleDeleteResult

                                                                                                                                                                                                                                                                                                                                                                                                            type BranchSingleDeleteResult =
                                                                                                                                                                                                                                                                                                                                                                                                            | BranchSingleDeleteFailure
                                                                                                                                                                                                                                                                                                                                                                                                            | BranchSingleDeleteSuccess;

                                                                                                                                                                                                                                                                                                                                                                                                              type CleanMode

                                                                                                                                                                                                                                                                                                                                                                                                              type CleanMode = CleanOptions.FORCE | CleanOptions.DRY_RUN;
                                                                                                                                                                                                                                                                                                                                                                                                              • The two modes git.clean can run in - one of these must be supplied in order for the command to not throw a TaskConfigurationError

                                                                                                                                                                                                                                                                                                                                                                                                              type CloneOptions

                                                                                                                                                                                                                                                                                                                                                                                                              type CloneOptions = Options &
                                                                                                                                                                                                                                                                                                                                                                                                              OptionFlags<
                                                                                                                                                                                                                                                                                                                                                                                                              | '--bare'
                                                                                                                                                                                                                                                                                                                                                                                                              | '--dissociate'
                                                                                                                                                                                                                                                                                                                                                                                                              | '--mirror'
                                                                                                                                                                                                                                                                                                                                                                                                              | '--no-checkout'
                                                                                                                                                                                                                                                                                                                                                                                                              | '--no-remote-submodules'
                                                                                                                                                                                                                                                                                                                                                                                                              | '--no-shallow-submodules'
                                                                                                                                                                                                                                                                                                                                                                                                              | '--no-single-branch'
                                                                                                                                                                                                                                                                                                                                                                                                              | '--no-tags'
                                                                                                                                                                                                                                                                                                                                                                                                              | '--remote-submodules'
                                                                                                                                                                                                                                                                                                                                                                                                              | '--single-branch'
                                                                                                                                                                                                                                                                                                                                                                                                              | '--shallow-submodules'
                                                                                                                                                                                                                                                                                                                                                                                                              | '--verbose'
                                                                                                                                                                                                                                                                                                                                                                                                              > &
                                                                                                                                                                                                                                                                                                                                                                                                              OptionFlags<'--depth' | '-j' | '--jobs', number> &
                                                                                                                                                                                                                                                                                                                                                                                                              OptionFlags<
                                                                                                                                                                                                                                                                                                                                                                                                              | '--branch'
                                                                                                                                                                                                                                                                                                                                                                                                              | '--origin'
                                                                                                                                                                                                                                                                                                                                                                                                              | '--recurse-submodules'
                                                                                                                                                                                                                                                                                                                                                                                                              | '--separate-git-dir'
                                                                                                                                                                                                                                                                                                                                                                                                              | '--shallow-exclude'
                                                                                                                                                                                                                                                                                                                                                                                                              | '--shallow-since'
                                                                                                                                                                                                                                                                                                                                                                                                              | '--template',
                                                                                                                                                                                                                                                                                                                                                                                                              string
                                                                                                                                                                                                                                                                                                                                                                                                              >;

                                                                                                                                                                                                                                                                                                                                                                                                                type CommitSummary

                                                                                                                                                                                                                                                                                                                                                                                                                type CommitSummary = CommitResult;
                                                                                                                                                                                                                                                                                                                                                                                                                • Deprecated

                                                                                                                                                                                                                                                                                                                                                                                                                  For consistent naming, please use CommitResult instead of CommitSummary

                                                                                                                                                                                                                                                                                                                                                                                                                type ListLogSummary

                                                                                                                                                                                                                                                                                                                                                                                                                type ListLogSummary<T = DefaultLogFields> = LogResult<T>;
                                                                                                                                                                                                                                                                                                                                                                                                                • Deprecated

                                                                                                                                                                                                                                                                                                                                                                                                                  to aid consistent naming, please use LogResult instead of ListLogSummary.

                                                                                                                                                                                                                                                                                                                                                                                                                type LogOptions

                                                                                                                                                                                                                                                                                                                                                                                                                type LogOptions<T = DefaultLogFields> = {
                                                                                                                                                                                                                                                                                                                                                                                                                file?: string;
                                                                                                                                                                                                                                                                                                                                                                                                                format?: T;
                                                                                                                                                                                                                                                                                                                                                                                                                from?: string;
                                                                                                                                                                                                                                                                                                                                                                                                                mailMap?: boolean;
                                                                                                                                                                                                                                                                                                                                                                                                                maxCount?: number;
                                                                                                                                                                                                                                                                                                                                                                                                                multiLine?: boolean;
                                                                                                                                                                                                                                                                                                                                                                                                                splitter?: string;
                                                                                                                                                                                                                                                                                                                                                                                                                strictDate?: boolean;
                                                                                                                                                                                                                                                                                                                                                                                                                symmetric?: boolean;
                                                                                                                                                                                                                                                                                                                                                                                                                to?: string;
                                                                                                                                                                                                                                                                                                                                                                                                                };

                                                                                                                                                                                                                                                                                                                                                                                                                  type MergeResult

                                                                                                                                                                                                                                                                                                                                                                                                                  type MergeResult = PullResult & MergeDetail;

                                                                                                                                                                                                                                                                                                                                                                                                                    type MergeResultStatus

                                                                                                                                                                                                                                                                                                                                                                                                                    type MergeResultStatus = 'success' | string;

                                                                                                                                                                                                                                                                                                                                                                                                                      type MergeSummary

                                                                                                                                                                                                                                                                                                                                                                                                                      type MergeSummary = MergeResult;
                                                                                                                                                                                                                                                                                                                                                                                                                      • Deprecated

                                                                                                                                                                                                                                                                                                                                                                                                                        For consistent naming, please use MergeResult instead of MergeSummary

                                                                                                                                                                                                                                                                                                                                                                                                                      type MoveSummary

                                                                                                                                                                                                                                                                                                                                                                                                                      type MoveSummary = MoveResult;

                                                                                                                                                                                                                                                                                                                                                                                                                        type Options

                                                                                                                                                                                                                                                                                                                                                                                                                        type Options = Record<string, OptionsValues>;

                                                                                                                                                                                                                                                                                                                                                                                                                          type outputHandler

                                                                                                                                                                                                                                                                                                                                                                                                                          type outputHandler = (
                                                                                                                                                                                                                                                                                                                                                                                                                          command: string,
                                                                                                                                                                                                                                                                                                                                                                                                                          stdout: NodeJS.ReadableStream,
                                                                                                                                                                                                                                                                                                                                                                                                                          stderr: NodeJS.ReadableStream,
                                                                                                                                                                                                                                                                                                                                                                                                                          args: string[]
                                                                                                                                                                                                                                                                                                                                                                                                                          ) => void;
                                                                                                                                                                                                                                                                                                                                                                                                                          • A function called by the executor immediately after creating a child process. Allows the calling application to implement custom handling of the incoming stream of data from the git.

                                                                                                                                                                                                                                                                                                                                                                                                                          type ResetOptions

                                                                                                                                                                                                                                                                                                                                                                                                                          type ResetOptions = Options &
                                                                                                                                                                                                                                                                                                                                                                                                                          OptionFlags<'-q' | '--quiet' | '--no-quiet' | '--pathspec-from-nul'> &
                                                                                                                                                                                                                                                                                                                                                                                                                          OptionFlags<'--pathspec-from-file', string>;

                                                                                                                                                                                                                                                                                                                                                                                                                            type Response

                                                                                                                                                                                                                                                                                                                                                                                                                            type Response<T> = SimpleGit & Promise<T>;

                                                                                                                                                                                                                                                                                                                                                                                                                              type SimpleGitTaskCallback

                                                                                                                                                                                                                                                                                                                                                                                                                              type SimpleGitTaskCallback<T = string, E extends GitError = GitError> = (
                                                                                                                                                                                                                                                                                                                                                                                                                              err: E | null,
                                                                                                                                                                                                                                                                                                                                                                                                                              data: T
                                                                                                                                                                                                                                                                                                                                                                                                                              ) => void;
                                                                                                                                                                                                                                                                                                                                                                                                                              • The node-style callback to a task accepts either two arguments with the first as a null and the second as the data, or just one argument which is an error.

                                                                                                                                                                                                                                                                                                                                                                                                                              type TaskOptions

                                                                                                                                                                                                                                                                                                                                                                                                                              type TaskOptions<O extends Options = Options> = string[] | O;
                                                                                                                                                                                                                                                                                                                                                                                                                              • Most tasks accept custom options as an array of strings as well as the options object. Unless the task is explicitly documented as such, the tasks will not accept both formats at the same time, preferring whichever appears last in the arguments.

                                                                                                                                                                                                                                                                                                                                                                                                                              Package Files (23)

                                                                                                                                                                                                                                                                                                                                                                                                                              Dependencies (5)

                                                                                                                                                                                                                                                                                                                                                                                                                              Dev Dependencies (0)

                                                                                                                                                                                                                                                                                                                                                                                                                              No dev dependencies.

                                                                                                                                                                                                                                                                                                                                                                                                                              Peer Dependencies (0)

                                                                                                                                                                                                                                                                                                                                                                                                                              No peer dependencies.

                                                                                                                                                                                                                                                                                                                                                                                                                              Badge

                                                                                                                                                                                                                                                                                                                                                                                                                              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                                                                                                                                                                                                                              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/simple-git.

                                                                                                                                                                                                                                                                                                                                                                                                                              • Markdown
                                                                                                                                                                                                                                                                                                                                                                                                                                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/simple-git)
                                                                                                                                                                                                                                                                                                                                                                                                                              • HTML
                                                                                                                                                                                                                                                                                                                                                                                                                                <a href="https://www.jsdocs.io/package/simple-git"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>