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

git fetch --tags doesn't quite do what I expect

From
TLTony Luck <tony.luck@gmail.com>
Date
Nov 18, 2005, 19:14 UTC
Message-ID
<12c511ca0511181114jf4ca3c0p195a128fa541b8f2@mail.gmail.com>

I've been doing some updating on my git scripts to make use of the features that you have been working hard to put in (thank you). My script to update my local "linus" branch from Linus' master branch at kernel.org had a simple "git fetch linus" (with the appropriate[1] URL and Pull lines in .git/refs/remotes/linus) followed by an unholy piece of script that parsed the output from "git-ls-remote --tags linus" to see if I had all the latest tags, and get them if I didn't.

Looking at the manual, I thought that I could just change the "git
fetch linus" to
be "git fetch --tags linus" and drop the script.  But it appears that
with the "--tags"
argument the "fetch" will not fetch anything beyond the tagged commits (i.e.
at the moment v2.6.15-rc1) ... so I need both:
      git fetch --tags linus
and
      git fetch linus
one to get any new tags, and the other to fetch all the way up to "master".

Is this intended behaivour? If so, the "--tags" entry on the git-fetch(1) man page needs a little extra text to say that --tags limits the fetch to only commits reachable from the tags.

-Tony
[1] Contents:
URL: master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Pull: master:linus
Next: Junio C Hamano
Message 1 of 3 in “git fetch --tags doesn't quite do what I expect”
  1. Tony LuckNov 18, 2005
  2. Junio C HamanoNov 18, 2005
  3. Luck, TonyNov 18, 2005

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.