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

Re: Find main branch

From
pedro rijo <pedrorijo91@gmail.com>
Date
Jan 15, 2016, 10:49 UTC
Message-ID
<CAPMsMoCHYEqSoR5UKBVK7yqSK=itRXxDDV0Kp7xwoykYRpzfWg@mail.gmail.com>
In-Reply-To
<20160114211335.GB10825@sigill.intra.peff.net>
Thanks guys, the last answer seems to work !
Wouldn't mind to have a git command that returned the main branch though :p

Thanks, Pedro Rijo

2016-01-14 21:13 GMT+00:00 Jeff King <peff@peff.net>:
Show 38 quoted lines
> On Thu, Jan 14, 2016 at 12:12:35PM -0700, Bryan Turner wrote:
>
>> The same thing works for GitHub. Here's the hazelcast/hazelcast repository:
>>
>> bturner@ubuntu:~$ git remote-https
>> https://github.com/hazelcast/hazelcast.git
>> https://github.com/hazelcast/hazelcast.git | head
>> list
>> @refs/heads/master HEAD
>> 988810c4b5c5195412c65357e06cbb0e51173258 refs/heads/3.1.8
>> bddfb328e4779bccec6f7788c94960f6292b02c9 refs/heads/3.2-fix-eacg
>> 84e7d1006cd342c39afdf0ac520b5b04b8233d75 refs/heads/3.3.6
>> 2e4ffc4f593de0869f0db9f7224f964f72dac15d refs/heads/3.4-gem
>> d0a7d416b1220ef4badd98e42991dabe34c7beeb refs/heads/3.5.1
>> 6a13721d33bdb07de23f5c505b689e2ee50d5abb refs/heads/3.5.3-ercssn
>> 56676b20baae8668e731f17c9f3b9844ddd486d0 refs/heads/3.5.4
>>
>> I'm not aware of a simple equivalent for SSH. Also, note that this
>> "git remote-https" trick won't work on Windows. When you hit Enter
>> after "list" it writes a CRLF, so the "git-remote-https" process
>> compares "listCR" against its list of known commands and finds no
>> match.
>
> There's no equivalent for ssh, because you're hooking in at the
> remote-helper layer, and ssh (and git://) are builtins, and http is not.
>
> I mentioned "git remote" elsewhere in the thread, which is probably the
> least gross way (it's just ugly because it writes to a file instead of
> to stdout). But you can also snoop on the protocol:
>
>   $ GIT_TRACE_PACKET=3 git ls-remote origin 3>&1 >/dev/null |
>     perl -lne '/symref=(\S+)/ and print $1'
>   HEAD:refs/heads/master
>
> It would be nice if "git ls-remote" just had some way of printing the
> capabilities.
>
> -Peff
-- 
Obrigado,

Pedro Rijo
Previous: Jeff KingNext: Junio C Hamano
Message 8 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.