版本控制-停止从特定的远程repo获取Git标记



问题:是否可以通过使用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).

最新更新