Re: default remote branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thibault Kruse <tibokruse@xxxxxxxxxxxxxx> writes:

> Also, I tried finding out whether I can use the
> .git/refs/remotes/<remote>/HEAD to check the default branch without
> accessing the remote. However, I find this file is not updated with a
> git fetch, nor created when missing.

That is more or less deliberate.  Which one of the branches to
consider the primary one becomes a local decision after you clone.
If that was a good choice may be debatable, but that is how existing
users expect things to work.

> So is there a sane way to get the last know default branch without
> accessing the remote?

"The last known" is not updated, due to "where remotes/origin/HEAD
points at is a local matter" design; there is nothing that locally
stores the information you are asking for, so there is no offline
way to answer that question.

An early part of the protocol exchange "git clone" does carry that
information, but I do not think there is a command to ask that to
the remote.  A logical place to add it would be a new option to "git
ls-remote", I would think.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]