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

Re: Symbolic 'references' in Git?

From
Jeff King <peff@peff.net>
Date
Apr 14, 2011, 22:20 UTC
Message-ID
<20110414222020.GB19222@sigill.intra.peff.net>
In-Reply-To
<BANLkTik5tD5UOrDkpL8ahEgwFjT+suHACQ@mail.gmail.com>
On Thu, Apr 14, 2011 at 05:31:13PM -0400, Chris Patti wrote:
Show 23 quoted lines
> >> Rather than resorting to manually copying the symbolic ref file
> >> around, from repo to repo, is there any way to make such a symbolic
> >> 'variable' global?
> >
> > Why not just use a tag or a branch ?
> >
> > git tag -F next-release release-3.15
> >
> >  OR
> >
> > git branch -D next-release
> > git branch next-release release-3.15
> >
> > (I personally think branches are nicer for this since tags are "supposed" to
> > be immutable.)
> >
> 
> 
> Won't either of those things create a 'next-release' that's frozen in
> time where the release-3.15 branch is *right now*?
> 
> This is for a CI system (Bamboo) so we need next-release to act as if
> we were using release-3.15 itself.

Yeah, a regular ref won't work for that. A symbolic ref is definitely what you want, but their contents are not shared via the git-protocol. So no, they won't make it across clones, fetches, or pushes. We do some ugly magic to make HEAD work.

-Peff
Previous: Chris PattiNext: Wesley J. Landaker
Message 4 of 7 in “Symbolic 'references' in Git?”
  1. Chris PattiApr 14, 2011
  2. Wesley J. LandakerApr 14, 2011
  3. Chris PattiApr 14, 2011
  4. Jeff KingApr 14, 2011
  5. Wesley J. LandakerApr 14, 2011
  6. Junio C HamanoApr 14, 2011
  7. Michael J GruberApr 15, 2011

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.