A nice and simple question - is the function of "git fetch" a strict sub-set of
git fetch --tags
git fetch --tags
git pull --tags
Note: starting with git 1.9/2.0 (Q1 2014),
git fetch --tags fetches tags in addition to what are fetched by the same command line without the option.
Previously, fetch's "
--tags" option was considered equivalent to specifying the refspec
on the command line; in particular, it caused the
remote.<name>.refspecconfiguration to be ignored.
But it is not very useful to fetch tags without also fetching other references, whereas it is quite useful to be able to fetch tags in addition to other references.
So change the semantics of this option to do the latter.
If a user wants to fetch only tags, then it is still possible to specifying an explicit refspec:
git fetch <remote> 'refs/tags/*:refs/tags/*'
Please note that the documentation prior to 18.104.22.168 was ambiguous about this aspect of "
fetch --tags" behavior.
Commit f0cb2f1 (2012-12-14)
fetch --tagsmade the documentation match the old behavior.
This commit changes the documentation to match the new behavior (see
Request that all tags be fetched from the remote in addition to whatever else is being fetched.
Since Git 2.5 (Q2 2015)
git pull --tags is more robust:
--tagserror in no merge candidates case
Since 441ed41 ("
git pull --tags": error out with a better message., 2007-12-28, Git 1.5.4+),
git pull --tagswould print a different error message if git-fetch did not return any merge candidates:
It doesn't make sense to pull all tags; you probably meant: git fetch --tags
This is because at that time,
git-fetch --tagswould override any configured refspecs, and thus there would be no merge candidates. The error message was thus introduced to prevent confusion.
However, since c5a84e9 (
fetch --tags: fetch tags in addition to other stuff, 2013-10-30, Git 1.9.0+),
git fetch --tagswould fetch tags in addition to any configured refspecs.
Hence, if any no merge candidates situation occurs, it is not because
--tagswas set. As such, this special error message is now irrelevant.
To prevent confusion, remove this error message.