Packages

simple-git

4.1.0 · 16 Nov 2026MIT15.5M / weekRepositorynpmAtom feed

Your version

2.10.0

23 Jun 2020Where it was published

2.48.0 is the newest release of 2.x.

In short

5 fixed

Security

8 advisories affect 2.10.0; 3.36.0 fixes the others

3 more

Release note

The section about simple-git of a note shared by several packages.

2.10.0 - trailing options in checkout, init, status, reset & bug-fix awaiting a non-task

  • git.checkout now supports both object and array forms of supplying trailing options.

import simpleGit from "simple-git";
await simpleGit().checkout("branch-name", ["--track", "remote/branch"]);
await simpleGit().checkout(["branch-name", "--track", "remote/branch"]);
await simpleGit().checkout({ "branch-name": null });
  • git.init now supports both object and array forms of supplying trailing options and now
    parses the response to return an InitResult;

import simpleGit, { InitResult } from "simple-git";
const notSharedInit: InitResult = await simpleGit().init(false, [
  "--shared=false",
]);
const notSharedBareInit: InitResult = await simpleGit().init([
  "--bare",
  "--shared=false",
]);
const sharedInit: InitResult = await simpleGit().init(false, {
  "--shared": "true",
});
const sharedBareInit: InitResult = await simpleGit().init({
  "--bare": null,
  "--shared": "false",
});
  • git.status now supports both object and array forms of supplying trailing options.

import simpleGit, { StatusResult } from "simple-git";
const repoStatus: StatusResult = await simpleGit().status();
const subDirStatus: StatusResult = await simpleGit().status(["--", "sub-dir"]);
  • git.reset upgraded to the new task style and exports an enum ResetMode with all supported
    merge modes and now supports both object and array forms of supplying trailing options.

import simpleGit, { ResetMode } from "simple-git";

// git reset --hard
await simpleGit().reset(ResetMode.HARD);

// git reset --soft -- sub-dir
await simpleGit().reset(ResetMode.SOFT, ["--", "sub-dir"]);
  • bug-fix: It should not be possible to await the simpleGit() task runner, only the tasks it returns.

expect(simpleGit().then).toBeUndefined();
expect(simpleGit().init().then).toBe(expect.any(Function));

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.