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

Re: Pushing symbolic references to remote repositories?

From
Andreas Schwab <schwab@linux-m68k.org>
Date
Dec 22, 2012, 09:26 UTC
Message-ID
<m2ehiiv3nb.fsf@linux-m68k.org>
In-Reply-To
<7vip7vrof6.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 15 quoted lines
> I think that the only one and a half sensible use cases that
> unconditionally make sense to update symrefs across repositories are
> to update bare.git/HEAD symref:
>
>  - update bare.git/HEAD of a repository that is a local mirror of a
>    more authoritative repository with "git fetch --mirror", in which
>    case you do want to follow what branch is designated as the
>    primary by the project you are mirroring from;
>
>  - update bare.git/HEAD from outside by some means to change which
>    branch is the primary one for the project. Only because your
>    hosting site does not give you an easy way to do so, pushing from
>    another repository that happens to point its HEAD at a different
>    branch seems to be one plausible way to do so, but that does not
>    have to be the only way.

This is not limited to HEAD, any ref may want to be set up as a symref at a remote repo. For example, I want to set up a symref master -> trunk at a repository I have no shell access to. Without this I get spurious error whenever I fetch from that remote (where master and trunk are separate refs) into a local mirror which does have the symref:

>From git://repo.or.cz/emacs
   f0ae89f..5595931  master     -> master
error: Ref refs/heads/trunk is at 559593152b9de5a1c144729e0583fa7968abab22 but expected f0ae89f92326beb3f5a19e90c8f4fe0ab6197926
 ! f0ae89f..5595931  trunk      -> trunk  (unable to update local ref)
Andreas.
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 6 in “Pushing symbolic references to remote repositories?”
  1. Dun PealDec 21, 2012
  2. Shawn PearceDec 21, 2012
  3. Junio C HamanoDec 21, 2012
  4. Andreas SchwabDec 22, 2012
  5. Junio C HamanoDec 22, 2012
  6. Sitaram ChamartyDec 23, 2012

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.