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

Re: unclear documentation of git fetch --tags option and tagopt config

From
Philip Oakley <philipoakley@iee.org>
Date
Dec 13, 2012, 23:47 UTC
Message-ID
<084AB408ED4E4CF3B048B8615658F158@PhilipOakley>
In-Reply-To
<7v7golzta8.fsf@alter.siamese.dyndns.org>
From: "Junio C Hamano" <gitster@pobox.com> Sent: Thursday, December 13, 
2012 6:44 PM
Show 37 quoted lines
> 乙酸鋰 <ch3cooli@gmail.com> writes:
>
>> With git fetch --tags
>> or remote.origin.tagopt = --tags
>> git fetch only fetches tags, but not branches.
>> Current documentation does not mention that no branches are fetched /
>> pulled when --tags option or remote.origin.tagopt = --tags is
>> specified.
>
> In the canonical form you spell out what you want to fetch from
> where, and a lazy "git fetch" or "git fetch origin" that does not
> specify what are to be fetched are the special cases.  Because they
> do not say what to fetch, they would become a no-op, which would not
> be very useful, if there is no special casing for them.  Instead,
> they use sensible default, taking refspec from the configuration
> variable remote.$name.fetch.
>
> Giving refspecs or the "--tags" option from the command line is a
> way to explicitly override this default, hence:
>
>    $ git fetch origin HEAD
>
> only fetches the history leading to the commit at HEAD at the
> remote, ignoring the configured refspecs.  As "--tags" is a synonym
> to "refs/tags/*:refs/tags/*", "git fetch --tags origin" tells us to
> ignore refspecs and grab only the tags, i.e.:
>
>    $ git fetch origin "refs/tags/*:refs/tags/*"
>
> which does not grab any branches.
>
> You can of course do:
>
>    $ git fetch --tags origin 
> refs/heads/master:refs/remotes/origin/master
>
> --

What would be the best way of updating the documentation to clarify the point? Given ch3cooli's previous surprise.

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “unclear documentation of git fetch --tags option and tagopt config”
  1. 乙酸鋰Dec 13, 2012
  2. Junio C HamanoDec 13, 2012
  3. Philip OakleyDec 13, 2012
  4. Junio C HamanoDec 14, 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.