【发布时间】:2022-01-01 18:18:31
【问题描述】:
我的存储库 'origin' 有几个我不想在 git log --all 中看到的分支。如何从本地存储库中排除单个远程分支?
【问题讨论】:
我的存储库 'origin' 有几个我不想在 git log --all 中看到的分支。如何从本地存储库中排除单个远程分支?
【问题讨论】:
您可以使用--not --remotes=,然后列出您想要排除的分支。
例如:
git log --all --not --remotes=origin/master, origin/HEAD
将仅列出 origin/develop 的提交,不包括 master 分支。
【讨论】:
alias。 git-scm.com/book/en/v2/Git-Basics-Git-Aliases
我发现这可以解决我的问题:
git config --add remote.origin.fetch ^refs/heads/remove-branch-I-want-to-ignore
【讨论】: