Skip to content

addPath

Add or update an index entry from a file on disk.

This forces the file to be added to the index, not looking at gitignore rules.

If this file currently is the result of a merge conflict, this file will no longer be marked as conflicting. The data about the conflict will be moved to the "resolve undo" (REUC) section.

Signature

ts
class Index {
  addPath(path: string): void;
}

Parameters

  • pathrequired · string

    Relative file path to the repository's working directory and must be readable.

Errors

  • Error

    This method will fail in bare index instances.

Released under the MIT License.