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

git fetch with refspec does not include tags?

From
CMCarlsson, Magnus <magnus.carlsson@arris.com>
Date
Aug 17, 2017, 09:02 UTC
Message-ID
<1502960572292.1402@arris.com>
In-Reply-To
<1502960406180.9006@arris.com>
Hi​
In the git fetch documentation it states that by default you will fetch all tags that point into the history to the branches fetched.
"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. This default behavior can be changed by using the --tags or --no-tags options or by configuring remote.<name>.tagOpt. By using a refspec that fetches tags explicitly, you can fetch tags that do not point into branches  you are interested in as well."
But for me I get tags if I do "git fetch" or "git fetch origin" but if I do "git fetch origin master" I don't get tags related to the master branch.
I understand that this might be due to me specifying a refspec and then it will only get that exact refspec, but for me it's not that clear from the documentation what I should expect. I read it as when I fetch something all related tags will come along.
Using: git version 2.13.0.rc1.15.gd2bbb7c
-- Magnus

MAGNUS CARLSSON Staff Software Engineer ARRIS

o: +46 13 36 75 92 e: magnus.carlsson@arris.com w: www.arris.com

ARRIS:  Legal entity: Arris Sweden AB - Registered Office: Teknikringen 2, 583 30 Linkoping, Sweden - Reg No:556518-5831 - VAT No:SE 556518-583
This electronic transmission (and any attached document) is for the sole use of the individual or entity to whom it is addressed.  It is confidential and may be attorney-client privileged.  In any event the Sender reserves, to the fullest extent, any "legal  advice privilege".  Any further distribution or copying of this message is strictly prohibited.  If you received this message in error, please notify the Sender immediately and destroy the attached message (and all attached documents).
       
Next: Jeff King
Message 1 of 12 in “git fetch with refspec does not include tags?”
  1. Carlsson, MagnusAug 17, 2017
  2. Jeff KingAug 17, 2017
  3. Carlsson, MagnusAug 17, 2017
  4. Jeff KingAug 17, 2017
  5. Junio C HamanoAug 17, 2017
  6. Junio C HamanoAug 17, 2017
  7. Kevin DaudtAug 17, 2017
  8. Junio C HamanoAug 17, 2017
  9. Kevin DaudtAug 17, 2017
  10. Jeff KingAug 20, 2017
  11. Jeff KingAug 20, 2017
  12. Junio C HamanoAug 20, 2017

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.