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
nulltoken edited this page May 25, 2011
·
14 revisions
git-log
Show HEAD commit logs
Limits the number of commits to show
Git
$ git log -15
LibGit2Sharp
using(varrepo=newRepository("path/to/your/repo")){foreach(varcommitinrepo.Commits.Take(15)){Console.WriteLine(commit.Id);// Of course the output can be prettified ;-)}}
Change the commit ordering
Git
$ git log --topo-order --reverse
LibGit2Sharp
using(varrepo=newRepository("path/to/your/repo")){varfilter=newFilter{SortBy=GitSortOptions.Topologicial|GitSortOptions.Reverse};foreach(varcommitinrepo.Commits.QueryBy(filter)){Console.WriteLine(commit.Id);// Of course the output can be prettified ;-)}}
Show only commits between two named commits
Git
$ git log master..development
LibGit2Sharp
using(varrepo=newRepository("path/to/your/repo")){varfilter=newFilter{Since=repo.Branches["master"],Until=repo.Branches["development"]};foreach(varcommitinrepo.Commits.QueryBy(filter)){Console.WriteLine(commit.Id);// Of course the output can be prettified ;-)}}