Skip to content

addIgnoreRule

Add ignore rules for a repository.

This adds ignore rules to the repository. The rules will be used in addition to any existing ignore rules (such as .gitignore files).

Signature

ts
class Repository {
  addIgnoreRule(rules: string): void;
}

Parameters

  • rulesrequired · string

    Rules to add, separated by newlines.

Examples

ts
import { openRepository } from 'es-git';

const repo = await openRepository('./path/to/repo');
repo.addIgnoreRule("node_modules/");

Released under the MIT License.