git pull - 默认情况下它会在远程获取标签吗?

标签 git git-pull git-tag

我知道 git fetch --tags 会将所有标签从远程获取到本地。

我不确定 git pull 默认情况下会从远程获取标签吗?

最佳答案

默认情况下,git pull 只会获取所获取对象可访问的标签。

来自git pull文档

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

因此,您还应该查看 tagopt 配置,了解 git 为您的存储库做了什么。

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.

关于git pull - 默认情况下它会在远程获取标签吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27716846/

相关文章:

c++ - 如何删除依赖项目中相同依赖源的重复项

git checkout -f master VS git reset

Git pull 从别人的fork

git - 当在本地 repo 上使用过滤器分支时,如何从远程 repo 中提取更新?

git - 需要带注释的标签并拒绝 git push 上的轻量级标签

git - 64 位 Windows 7 上的 msysGit

带有 refspec 差异的 Git pull/fetch

git - 为什么 git 标记一个 blob 或一棵树(或一个标签)?

Git 标签列表,显示提交的 sha1 哈希值

Github 发布 - 如何部署发布