Skip to content
Jason edited this page Mar 5, 2015 · 7 revisions

The following examples assume you already have a repository in place to work with. If not, see git-init.

Add to a non-bare repository

If you want to stage (add) a file in a repository that is checked out to the file system, you can stage a file with changes like so:

using (var repo = new Repository("path/to/your/repo"))
{
    // Stage the file
    repo.Index.Stage("file/with/changes.txt");
}

Clone this wiki locally