我知道 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/