git_ignore_add_rule

Add ignore rules for a repository.

Excludesfile rules (i.e. .gitignore rules) are generally read from .gitignore files in the repository tree or from a shared system file only if a "core.excludesfile" config value is set. The library also keeps a set of per-repository internal ignores that can be configured in-memory and will not persist. This function allows you to add to that internal rules list.

Example usage:

error = git_ignore_add_rule(myrepo, "*.c\ndir/\nFile with space\n");

This would add three rules to the ignores.

extern (C) nothrow @nogc
int
git_ignore_add_rule

Parameters

repo libgit2_d.types.git_repository*

The repository to add ignore rules to.

rules const(char)*

Text of rules, a la the contents of a .gitignore file. It is okay to have multiple rules in the text; if so, each rule should be terminated with a newline.

Return Value

Type: int

0 on success

Meta