Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7915823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:35:10+00:00 2026-06-03T14:35:10+00:00

I tried looping through new LibGit2Sharp.Repository(path).Commits , but it seems it only goes through

  • 0

I tried looping through new LibGit2Sharp.Repository(path).Commits, but it seems it only goes through the commits in the master (or I guess wherever the HEAD points to?).

How would I loop through every commit in the repository, regardless of what branch it is in and loop through them in order of when the commits occurred (date)?

I’m doing this for a purpose like git log, to list commits regardless of the branches, in order of date.

Bonus points if I could also loop through the commits that are not referenced (i.e. if you git reset away from some commits and the commits are no longer referenced and about to get gc’d).

Thoughts?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:35:13+00:00Added an answer on June 3, 2026 at 2:35 pm

    Support for git log --all should be achievable with the following syntax

    using (var repo = new Repository(yourRepoPath))
    {
          var commits = repo.Commits.QueryBy(new Filter { Since = repo.Refs });
    }
    

    The Filter also exposes a SortBy property to control the ordering of the results. Default sorting (GitSortOptions.Time) will output the most recent commits first.

    Bonus points if I could also loop through the commits that are not referenced

    There’s no way to access the commits in the reflog nor the dangling one (yet?). Then, no bonus points, I guess 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried urllib{2}, pycurl and I'm looking at twisted's new http client. But: I
OK, nobody seems to know how to solve the problem I'm having looping through
I've tried looking at similar problems, but could not easily find one that helped
I've tried looking around and there are similar problems, but mine is way more
i have tried looking online but had no luck, How i could delete all
I know silly question but i tried looking it up on Google with no
What exactly does execve() do? I've tried looking at the documentation (http://linux.die.net/man/2/execve) but given
I have a loop which goes through a video with some processing/calculations of the
I've tried to use achart engine but the documentation is somewhat unclear. I've also
I am new to jQuery but have a question I hope some of you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.