git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Beller <sbeller@google.com>
To: pedro rijo <pedrorijo91@gmail.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Find main branch
Date: Thu, 14 Jan 2016 10:26:45 -0800	[thread overview]
Message-ID: <CAGZ79kbHSOm3OxEOXUXt0NDTPknyb435w_WOB4XW_-gtt3TH0A@mail.gmail.com> (raw)
In-Reply-To: <CAPMsMoDsay7_n53HY6cxHWEtv5vyugxYUZqwi9tU4dKLv6MGBg@mail.gmail.com>

Looking at the capabilities the server sends you.
(I forgot if there is a git command for it, but:)

# check for http://github.com/gitster/git
ssh git@github.com git-upload-pack gitster/git
0104fc10eb5b87a75af2cb93a3932897572f2c544915 HEADmulti_ack thin-pack
side-band side-band-64k ofs-delta shallow no-progress include-tag
multi_ack_detailed symref=HEAD:refs/heads/master
agent=git/2:2.4.8~peff-symbolic-refs-iii-revenge-of-the-sith-1258-gc4b0e8b

Notice the "symref=HEAD:refs/heads/master", which is what you want.

On Thu, Jan 14, 2016 at 10:17 AM, pedro rijo <pedrorijo91@gmail.com> wrote:
> Hey,
>
> If I clone a repo, the repo will be on a specific branch, the 'main'
> (typically 'master') branch.
>
> Is there any direct command to find that main branch, since that
> information is present?
>
> If so, is there any way to find it without actually cloning the repo
> (similar to git ls-remote)?
>
> --
> Thanks,
>
> Pedro Rijo
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-01-14 18:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-14 18:17 Find main branch pedro rijo
2016-01-14 18:26 ` Stefan Beller [this message]
2016-01-14 18:31 ` Konstantin Khomoutov
2016-01-14 18:40   ` pedro rijo
2016-01-14 18:53     ` Konstantin Khomoutov
2016-01-14 19:12     ` Bryan Turner
2016-01-14 21:13       ` Jeff King
2016-01-15 10:49         ` pedro rijo
2016-01-15 17:30         ` Junio C Hamano
2016-01-15 18:02           ` Jeff King
2016-01-14 21:04     ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGZ79kbHSOm3OxEOXUXt0NDTPknyb435w_WOB4XW_-gtt3TH0A@mail.gmail.com \
    --to=sbeller@google.com \
    --cc=git@vger.kernel.org \
    --cc=pedrorijo91@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).