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 26, 2011
·
14 revisions
git-log
Show HEAD commit logs
Limiting the number of commits to show
Git
$ git log -15
LibGit2Sharp
using(varrepo=newRepository("path/to/your/repo")){foreach(Commitcinrepo.Commits.Take(15)){Console.WriteLine(c.Id);// Of course the output can be prettified ;-)}}
Changing the order of the commits
Git
$ git log --topo-order --reverse
LibGit2Sharp
using(varrepo=newRepository("path/to/your/repo")){varfilter=newFilter{SortBy=GitSortOptions.Topological|GitSortOptions.Reverse};foreach(Commitcinrepo.Commits.QueryBy(filter)){Console.WriteLine(c.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(Commitcinrepo.Commits.QueryBy(filter)){Console.WriteLine(c.Id);// Of course the output can be prettified ;-)}}