Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Getting default branch of remote repository

Do an ls-remote, check the capabilities for "HEAD=<branch>".

Maybe Git could learn to just obtain said HEAD in a "clone --single-branch".

On Tue, Mar 14, 2017 at 5:50 AM, Alaa Nassef <alan.125@xxxxxxxxx> wrote:
> Hello All,
>
> What I need to do is to find out the default branch of of a remote repository, i.e. find out the branch where HEAD symbolic ref points to. I need to do this without cloning the whole repo, so that I can fetch only this branch.
>
> Thanks & Best Regards
> Alaa Nassef
> _______________________________________________
> jgit-dev mailing list
> jgit-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/jgit-dev


Back to the top