请注意,从git 1.9/2.0(2014年第一季度)开始, git fetch --tags 将获取所有内容(如 git fetch )以及标签.请参阅"" git fetch --tags "是否包含" git fetch "?".因此,您可以尝试 remote.< name> .tagOpt 配置选项: git config(--global)remote.< name> .tagOpt-标签 This may or may not be a very dumb idea, but how can you configure a git repository such that any pull that is done automatically fetches the tags from the other repository as well?According to the docs, it looks like you can do this on a per remote reposistory basis:Is there way to make --tags the default flag to fetch for every fetch? 解决方案 Fetching tags has a different effect than fetching commits (git fetch), as explained in "Does "git fetch --tags" include "git fetch"?".The latter will update branch heads, and will actually fetch tags reachable from those updated branches.The former will fetch all tags, but won't update the branch heads.So if your tags are reacheable from the branches you are fetching, you don't have to include --tags by default.Considering the large history of some repos (including the linux one), always wanting to fetch all tags might lead to tag list cluttering (a list of tag pollutted by hundreds of not-needed tags).Note that starting git 1.9/2.0 (Q1 2014), git fetch --tags will fetch everything (like git fetch), plus the tags. See "Does "git fetch --tags" include "git fetch"?".So you can try the remote.<name>.tagOpt config option:git config (--global) remote.<name>.tagOpt --tags 这篇关于如何配置git以在每次拉动时自动获取标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-22 03:50