0
votes

I want to list all the commits on the remote without actually cloning the remote repository locally. Using git, I can do this by the command:

git show-branch --more=500 master

Do we have a way to do this using LibGit2Sharp as well?

1

1 Answers

0
votes

I want to list all the commits on the remote without actually cloning the remote repository locally. Using git, I can do this by the command:

git show-branch only operates on a local repository. It doesn't retrieve any commit from the configured remotes.

Do we have a way to do this using LibGit2Sharp as well?

The following piece of code should emulate git show-branch

var branch = repository.Branches["master"];

foreach (var commit in branch.Commits)
{
    Console.WriteLine("{0}: {1}", commit.Id.ToString(7), commit.MessageShort);
}