simple-git
4.1.0 · 16 Nov 2026MIT15.5M / weekRepositorynpmAtom feed
4.1.0 is the newest release of 4.x.
In short
2 removed2 new1 fixed1 changed1 internal
- Removed
Removed previously available default export, now uses a consistently named
simpleGitexport. - Removed
Removed legacy
gitPexport (change to using the mainsimpleGitexport).
Security
Fixes 2 advisories that affected 3.36.0
- Highsimple-git allows command execution through unblocked Git configuration includesGHSA-g4wm-2vf7-vfgr · 5 Oct 2026Fixed in 4.0.0
- Highsimple-git: unsafe-operations plugin bypass via git long-option abbreviation (--receive-p/--exe) -> command execution (residual of CVE-2026-28291)GHSA-858h-whjf-mvg5 · 5 Oct 2026Fixed in 4.0.0
1 advisory affects 4.0.0; 4.0.1 fixes them
- Criticalsimple-git unsafe-operation guard does not block trailer command configurationGHSA-x6jw-m9v5-85vh · 5 Oct 2026Fixed in 4.0.1
Release note
Major Changes
- Breaking
Major upgrade to v4. In this version:
Removed previously available default export, now uses a consistently named
simpleGitexport.Removed previously deprecated import
simple-git/promise(change to using the mainsimple-gitimport).Removed legacy
gitPexport (change to using the mainsimpleGitexport).
// v3 - previously supported imports import simpleGit from "simple-git"; import { gitP } from "simple-git"; import simpleGit from "simple-git/promise"; const simpleGit = require("simple-git"); // v4 - consolidates to a single supported import import { simpleGit } from "simple-git"; const { simpleGit } = require("simple-git");Prevents the use of abbreviated long-form
gitoptions:
// v3 - allowed the use of unambiguous long-form options git.raw("clone", "--conf=user.name=me", "..."); // v4 - requires full option names, abbreviated option names will now throw a GitConfigurationError git.raw("fetch", "--config=user.name=me", "...");Ambient environment variables are filtered before passing into the
gitchild process.
// v3 process.env.FOO = "bar"; process.env.GIT_TEMPLATE_DIR = "./some/path"; simpleGit().raw("clone"); // git child process can see both environment variables // v4 process.env.FOO = "bar"; process.env.GIT_TEMPLATE_DIR = "./some/path"; simpleGit().raw("clone"); // git child process now sees only FOO simpleGit({ // explicitly allow the named environment variable so it can pass through. allowEnvoronment: ["GIT_TEMPLATE_DIR"], // and enable the use of an unsafe behaviour unsafe: { allowUnsafeTemplateDir: true }, });Explicitly supplied disallowed environment variables will throw when used.
// v3 used a single opt-in to potential unsafe actiity simpleGit({ unsafe: { allowUnsafeTemplateDir: true } }) .env({ GIT_TEMPLATE_DIR: "./foo" }) .init(); // v4 uses a double opt-in, allow the behaviour and the mechanism simpleGit({ allowEnvoronment: ["GIT_TEMPLATE_DIR"], unsafe: { allowUnsafeTemplateDir: true }, }) .env({ GIT_TEMPLATE_DIR: "./foo" }) .init();Removed content deprecated during the v2 to v3 major change
simpleGit.silent()logging is configured through environment variables in thedebugpackagesimpleGit.clearQueue()this has been a noop since v3, switch to using theabortpluginAccessing parsed properties of a
GitResponseErrorthrough a trailing callback function are available only through theerror.gitproperty (previously properties were also spread onto theerroritself with a deprecation notice).
Minor Changes
Support one-shot stdin via
git.input(data)(stringorBuffer).
Patch Changes
Add
allowUnsafeExecdetection torebase -xandrebase --exec.Parse binary rename entries without byte counts in diff summaries.
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.