libgit2sharp icon indicating copy to clipboard operation
libgit2sharp copied to clipboard

Add implementation for git_remote_default_branch

Open mburtka opened this issue 2 years ago • 2 comments

Implements the feature requested in #1796

This fetches the default branch from a remote repository. This is useful to detect changes, and when remotes are added following initialization.

mburtka avatar May 18 '22 21:05 mburtka

Hi @mburtka ,

May I suggest you to have a look at the similar functionality implemented in our fork and consider adopting (part of) it?

https://github.com/mendix/libgit2sharp/commit/d6e7723820cc4cd5c9abe006710c80a20d41fb9c

The difference is I believe that we've exposed the GetRemoteDefaultBranch as a static method on Repository class, so that the user could get a default branch name before they clone a repo.

ghost avatar Jul 19 '22 15:07 ghost

Is there any update on this?

Would love to set a default branch while initializing an empty repository. Thanks.

atiq-cs avatar Dec 17 '22 21:12 atiq-cs