diff --git a/simple-git/src/lib/simple-git-api.ts b/simple-git/src/lib/simple-git-api.ts index ee5182c2..6efc7900 100644 --- a/simple-git/src/lib/simple-git-api.ts +++ b/simple-git/src/lib/simple-git-api.ts @@ -39,9 +39,9 @@ export class SimpleGitApi implements SimpleGitBase { }); } - add(files: string | string[]) { + add(files: string | string[], force: bool = false) { return this._runTask( - straightThroughStringTask(['add', ...asArray(files)]), + straightThroughStringTask(['add', force ? '-f': '', ...asArray(files)]), trailingFunctionArgument(arguments) ); } diff --git a/simple-git/typings/simple-git.d.ts b/simple-git/typings/simple-git.d.ts index f4ecfdc2..7a392437 100644 --- a/simple-git/typings/simple-git.d.ts +++ b/simple-git/typings/simple-git.d.ts @@ -16,7 +16,7 @@ export interface SimpleGitBase { /** * Adds one or more files to source control */ - add(files: string | string[], callback?: types.SimpleGitTaskCallback): Response; + add(files: string | string[], force: bool = false, callback?: types.SimpleGitTaskCallback): Response; /** * Sets the working directory of the subsequent commands.