forked from libgit2/libgit2sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Git add
treischl edited this page Jun 3, 2016
·
7 revisions
The following examples assume you already have a repository in place to work with. If not, see git-init.
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.Add("file/with/changes.txt");
}
$ git add --all .
using (var repo = new Repository("path/to/your/repo"))
{
Commands.Stage(repo, "*");
}