Skip to content

init

Copy submodule info into ".git/config" file.

Just like "git submodule init", this copies information about the submodule into ".git/config". You can use the accessor functions above to alter the in-memory git_submodule object and control what is written to the config, overriding what is in .gitmodules.

By default, existing entries will not be overwritten, but passing true for overwrite forces them to be updated.

Signature

ts
class Submodule {
  init(
    overwrite?: boolean | null | undefined,
    signal?: AbortSignal | null | undefined,
  ): Promise<void>;
}

Parameters

  • overwritenull | boolean

    By default, existing entries will not be overwritten, but setting this to true forces them to be updated.

  • signalnull | AbortSignal

    Optional AbortSignal to cancel the operation.

Released under the MIT License.