Skip to content

Instantly share code, notes, and snippets.

@pheew
Created December 11, 2008 23:01
Show Gist options
  • Save pheew/34922 to your computer and use it in GitHub Desktop.
Save pheew/34922 to your computer and use it in GitHub Desktop.
WalkHistory(repo.HEAD.Commit); // Walk history from HEAD
WalkHistory(repo.Branches["experimental"].Commit); // Walk history from branch
private void WalkHistory(Commit commit)
{
Console.WriteLine("SHA: " + commit.SHA);
Console.WriteLine("Committed on: " + commit.CommittedDate);
Console.WriteLine("By: " + commit.Committer);
if (commit.HasParents)
{
foreach(Commit parent in commit.Parent)
WalkHistory(parent);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment