问题:是否可以通过使用git fetch Repo1
而不是必须使用--no-tags
来默认不提取标记?
软件:
- Git
- Git流
- Git流挂钩
- 启动发布或修补程序时自动切换版本。生成版本,写入文件并提交
- 自动指定标记消息
- 适用于Mac OS X的Tower应用程序
描述:我有两个存储库,Repo1和Repo2。两个Repo都使用标签来标记版本(0.0.1版),但版本之间完全不同。
git fetch Repo1
会自动从存储库中获取标记,但我需要它停止从Repo1中获取标签,因为它会导致Git Flow Hooks出现问题。我知道我可以使用git fetch Repo1 --no-tags
,但我使用的是Tower应用程序,而不是命令行,它设置为每30分钟提取一次。
在.gitconfig
中,指定remote.remote-name.tagopt
。来自git-config
手册页:
remote.<name>.tagopt
Setting this value to --no-tags disables automatic tag following when fetching from remote <name>. Setting it to --tags will fetch every tag from remote <name>,
even if they are not reachable from remote branch heads. Passing these flags directly to git-fetch(1) can override this setting. See options --tags and --no-tags of
git-fetch(1).