本文介绍了删除由git branch -a列出的分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

命令 >在这种情况下),在远程存储库中删除相应的分支之后剩下的,您可以删除所有这样的远程跟踪分支:

 
git remote prune origin

的文档解释为:


The command git branch -a lists a bunch of branches that are NOT on the repository, and NOT local branches. How can these be deleted?

* develop
  master
  remotes/origin/cloner

For example, remotes/origin/cloner used to exist in the repo, but it has since been deleted and I'd like it not to appear when typing git branch -a.

解决方案

If you have remote-tracking branches (such as origin/cloner in this case) which are left over after the corresponding branch has been deleted in the remote repository, you can delete all such remote-tracking branches with:

git remote prune origin

The documentation for git remote explains this as:

这篇关于删除由git branch -a列出的分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 20:14