Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add implementation for git_remote_default_branch #1969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mburtka wants to merge 1 commit into libgit2:master
base: master
Choose a base branch
Loading
from mburtka:remote-default-branch

Conversation

@mburtka
Copy link

@mburtka mburtka commented May 18, 2022
edited
Loading

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.

JanKrivanek, wfjsw, johnkors, and Athari reacted with hooray emoji
Copy link

ghost commented Jul 19, 2022

Hi @mburtka ,

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

mendix/libgit2sharp@d6e7723

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.

Copy link

atiq-cs commented Dec 17, 2022

Is there any update on this?

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

johnkors, BastianKamp, and Athari reacted with thumbs up emoji

Copy link

Athari commented Aug 27, 2025

Any chance of getting this merged? It's still a simple change with no conflicts, so can be done at any point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /