git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Find main branch

From
Stefan Beller <sbeller@google.com>
Date
Jan 14, 2016, 18:26 UTC
Message-ID
<CAGZ79kbHSOm3OxEOXUXt0NDTPknyb435w_WOB4XW_-gtt3TH0A@mail.gmail.com>
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:
Show 19 quoted lines
> 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
Previous: pedro rijoNext: Konstantin Khomoutov
Message 2 of 11 in “Find main branch”
  1. pedro rijoJan 14, 2016
  2. Stefan BellerJan 14, 2016
  3. Konstantin KhomoutovJan 14, 2016
  4. pedro rijoJan 14, 2016
  5. Konstantin KhomoutovJan 14, 2016
  6. Bryan TurnerJan 14, 2016
  7. Jeff KingJan 14, 2016
  8. pedro rijoJan 15, 2016
  9. Junio C HamanoJan 15, 2016
  10. Jeff KingJan 15, 2016
  11. Jeff KingJan 14, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.