【问题标题】:git exclude individual branches from fetchgit 从 fetch 中排除单个分支
【发布时间】:2022-01-01 18:18:31
【问题描述】:

我的存储库 'origin' 有几个我不想在 git log --all 中看到的分支。如何从本地存储库中排除单个远程分支?

【问题讨论】:

    标签: git branch


    【解决方案1】:

    您可以使用--not --remotes=,然后列出您想要排除的分支。 例如: git log --all --not --remotes=origin/master, origin/HEAD 将仅列出 origin/develop 的提交,不包括 master 分支。

    【讨论】:

    【解决方案2】:

    我发现这可以解决我的问题:

    git config --add remote.origin.fetch ^refs/heads/remove-branch-I-want-to-ignore
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-11-17
      • 1970-01-01
      • 2015-06-17
      • 2016-10-06
      • 2011-09-28
      • 2020-08-17
      • 2012-12-11
      • 1970-01-01
      相关资源
      最近更新 更多