Skip to content

Instantly share code, notes, and snippets.

@txdv
Created April 27, 2013 18:30
Show Gist options
  • Save txdv/5474093 to your computer and use it in GitHub Desktop.
Save txdv/5474093 to your computer and use it in GitHub Desktop.
orphan commit creation
var blob = repo.ObjectDatabase.CreateBlob("index.txt");
var treeDefinition = new TreeDefinition();
treeDefinition.Add("index.txt", blob, Mode.NonExecutableFile);
var tree = repo.ObjectDatabase.CreateTree(treeDefinition);
var commit = repo.ObjectDatabase.CreateCommit("Hello World",
new Signature("name", "mail", DateTimeOffset.Now),
new Signature("name", "mail", DateTimeOffset.Now),
tree, new Commit[0]);
repo.Branches.Add("index", commit);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment