コンテンツにスキップ

EnvInheritance

このコンテンツはまだ日本語訳がありません。

EnvInheritance = boolean | string[] | EnvAllowlistAdjustment | EnvInheritancePredicate

Defined in: src/core/env.ts:58

Controls how the parent process environment is inherited by spawned Git commands.

  • undefined (default): inherit only DEFAULT_ENV_ALLOWLIST — the variables Git needs to function. Sensitive variables are not passed through.
  • true: inherit the entire parent environment (legacy behavior, opt-in).
  • false: inherit nothing. The child only receives explicitly provided variables and values computed by the library (e.g. HOME, PATH prefixes). Note that this may break Git if PATH is not otherwise supplied.
  • string[]: inherit DEFAULT_ENV_ALLOWLIST plus the named variables. Use this to explicitly opt specific variables (e.g. an SSH command or a token) back in.
  • { add?, remove? }: inherit DEFAULT_ENV_ALLOWLIST, plus add, minus remove. Use this to drop a single default entry without rebuilding the whole allowlist.
  • (name) => boolean: a predicate that decides each variable individually, bypassing the default allowlist entirely.