You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 3, 2023. It is now read-only.
James Sconfitto edited this page Jul 29, 2013
·
5 revisions
The following examples assume you already have a repository in place to work with. If not, see git-init.
Committing to a non-bare repository
If you want to commit to a repository that is checked out to the file system, you can update the file on the file system and use the repository's Commit method.
using(varrepo=newRepository("path/to/your/repo")){// Write content to file systemvarcontent="Commit this!";File.WriteAllText(Path.Combine(repo.Info.WorkingDirectory,"fileToCommit.txt"),content);// Stage the filerepo.Index.Stage("fileToCommit.txt");// Create the committer's signature and commitSignatureauthor=newSignature("James","@jugglingnutcase",DateTime.Now);Signaturecommitter=author;// Commit to the repositoryCommitcommit=repo.Commit("Here's a commit i made!",author,committer);}