git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Konstantin Khomoutov <kostix+git@007spb.ru>
To: pedro rijo <pedrorijo91@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Find main branch
Date: Thu, 14 Jan 2016 21:53:12 +0300	[thread overview]
Message-ID: <20160114215312.255f26416bb93beb2e18f1f2@domain007.com> (raw)
In-Reply-To: <CAPMsMoBNzmK618NPP-VXP_70hTxTsa13O9f_usiCPJ-SUOUz_g@mail.gmail.com>

On Thu, 14 Jan 2016 18:40:15 +0000
pedro rijo <pedrorijo91@gmail.com> wrote:

> Stefan Beller solution is based on the server, which may not be very
> easy to do when dealing with Github/Bitbucket/Gitlab and other God
> knows which provider.
> 
> Konstantin ls-remote solution is the one I'm already using, but if I
> have several branches on that commit, I will not be able to decide.
> 
> I thought that the 'main' branch information was stored in git, and
> possibly with some way to access it with a git command

It *is* stored in the Git repository -- in the HEAD ref.
The question of how to retreive precisely this bit of information --
I don't really know.  Basically you want `git show-remote-ref --head`
but Git does not have such a command, only `git show-ref` ;-)

  reply	other threads:[~2016-01-14 18:53 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
2016-01-14 18:31 ` Konstantin Khomoutov
2016-01-14 18:40   ` pedro rijo
2016-01-14 18:53     ` Konstantin Khomoutov [this message]
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=20160114215312.255f26416bb93beb2e18f1f2@domain007.com \
    --to=kostix+git@007spb.ru \
    --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).