libgit2

git_index_add

Version:

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

Signature

int git_index_add(git_index *index, const char *path, int stage);

Parameters

In
index

an existing index object

const char *
In
path

filename to add

int
In
stage

stage for the entry

Returns

int

0 on success, otherwise an error code

Versions