Git add
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.Add("file/with/changes.txt");
}Stage all working directory changes
Git
$ git add --all .
LibGit2Sharp
using (var repo = new Repository("path/to/your/repo"))
{
Commands.Stage(repo, "*");
}
Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
