【问题标题】:Stop getting Git tags from specific remote repo停止从特定的远程仓库获取 Git 标签
【发布时间】:2015-09-15 04:14:28
【问题描述】:

问题:是否可以默认不使用git fetch Repo1而不是--no-tags来获取标签?

软件:

说明:我有两个存储库,Repo1 和 Repo2。两个 Repo 都使用标签来标记版本(v0.0.1),但版本完全不同。

git fetch Repo1 自动从存储库获取标签,但我需要它停止从 Repo1 获取标签,因为它会导致 Git Flow Hooks 出现问题。我知道我可以使用git fetch Repo1 --no-tags,但我使用的是 Tower 应用程序而不是命令行,它设置为每 30 分钟获取一次。

【问题讨论】:

    标签: git version-control version githooks git-flow


    【解决方案1】:

    在您的.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).
    

    【讨论】:

      猜你喜欢
      • 2013-09-22
      • 1970-01-01
      • 1970-01-01
      • 2012-05-25
      • 1970-01-01
      • 1970-01-01
      • 2018-10-31
      • 2018-10-27
      • 1970-01-01
      相关资源
      最近更新 更多