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

Re: missing tags from "git fetch"

From
Jeff King <peff@peff.net>
Date
Oct 2, 2019, 13:55 UTC
Message-ID
<20191002135518.GA3599@sigill.intra.peff.net>
In-Reply-To
<alpine.LSU.2.20.1910021431130.32588@cpza.bfz-tzou.qr>
On Wed, Oct 02, 2019 at 03:10:12PM +0200, Martin Nicolay wrote:
Show 11 quoted lines
> I don't know if this is a lack of understanding or a software or
> documentation bug.
> 
> man git-fetch says about tags:
>        By default, any tag that points into the histories being fetched is
>        also fetched; the effect is to fetch tags that point at branches that
>        you are interested in.
> 
> If I fetch without --tags the tags that point to the commits of the fetched
> branch are not fetched. If I fetch with --tags than all tags are fetched but
> I only wish to fetch tags pointing to something in the branch fetched.

It's a documentation bug, I think. We won't auto-follow tags when fetching into FETCH_HEAD (but this is further confused by the fact that fetching into FETCH_HEAD will auto-update a tracking ref).

So instead of this:
> $ git fetch origin master
try this:
  $ git fetch origin
or even this:
  $ git fetch origin master:refs/remotes/origin/master

There's more discussion in this thread (but it looks like no patches ever came out of it):

  https://public-inbox.org/git/20170817092853.hteuzni5lxia4ejf@sigill.intra.peff.net/
-Peff
Previous: Martin NicolayNext: Martin Nicolay
Message 2 of 5 in “missing tags from "git fetch"”
  1. Martin NicolayOct 2, 2019
  2. Jeff KingOct 2, 2019
  3. Martin NicolayOct 2, 2019
  4. Martin NicolayOct 25, 2019
  5. Jeff KingNov 22, 2019

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.