# git fetch automatic tag fetching - confusing when on or off

1 messages from 2026-07-09 to 2026-07-09. Participants: Ondra Medek.
Thread: https://gitlist.dev/t/65957

## Ondra Medek, 2026-07-09 07:33

Subject: git fetch automatic tag fetching - confusing when on or off
Message-ID: <CAJsoDaFJLk5d7awSR1t6C7+F6d_1gv+qQCQHKzb_YA6dZzXfQA@mail.gmail.com>

```
Hi,
In git fetch documentation https://git-scm.com/docs/git-fetch is:

> 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.

However, sometimes this automatic tag fetching works and sometimes not
and it's mentioned in docs when and why. See the following examples.
(I have no any git config setting regarding tag fetching set).

All these commands DO NOT automatically fetch tags:

git fetch origin master
git fetch origin master:
git fetch origin refs/heads/master
git fetch origin refs/heads/master:

While specifying :dst part of refspec DOES automatic tags fetching:

git fetch origin refs/heads/master:refs/remotes/origin/master

What is even more confusing (or maybe a bug), adding a nonexistent
refs prefix (i.e. with no real refs in local or remote repository)
DOES tags fetching even for "master" branch:

git fetch origin master refs/none/*:refs/none/*

So, it seems to me any refspec with :dst part triggers automatic tag
fetching for all refspecs? Please, document (or fix) this behaviour.

Note: I've prepared tests with
git tag tagTest master
git push --tags origin
And deleted local tag before each test
git tag -d tagTest

Thanks and best regards
Ondřej Medek

```
