Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git pull - will it fetch tags on remote by default?

I know git fetch --tags will fetch all tags from remote to local.

I am not sure will git pull get tags from remote by default, so will it or not?

like image 708
user218867 Avatar asked Nov 15 '25 12:11

user218867


2 Answers

A git pull will by default only fetch tags that are reachable by the objects that are fetched.

From the git pull documentation

--no-tags

By default, tags that point at objects that are downloaded from the remote repository are fetched and stored locally. This option disables this automatic tag following. The default behavior for a remote may be specified with the remote.<name>.tagopt setting. See git-config[1].

So you should also take a look at the tagopt config to see what git does for your repository.

remote.<name>.tagopt

Setting this value to --no-tags disables automatic tag following when fetching from remote . Setting it to --tags will fetch every tag from remote , even if they are not reachable from remote branch heads. Passing these flags directly to git-fetch1 can override this setting. See options --tags and --no-tags of git-fetch1.

like image 141
René Link Avatar answered Nov 17 '25 08:11

René Link


It should, since git pull does a git fetch and a git merge.

But it will do so only from git 1.9.0+, as I mentioned in "Does “git fetch --tags” include “git fetch”?".

like image 45
VonC Avatar answered Nov 17 '25 10:11

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!