[英]How to clear (delete) all merged local branches?
Sometimes I have a few versions of the same features on other branches which has very similar names.有时我在名称非常相似的其他分支上有几个相同功能的版本。 How can I remove all local branches which are not on remote repo?
如何删除不在远程仓库中的所有本地分支?
A little example: My local branches:一个小例子:我当地的分支机构:
feature/authorization功能/授权
feature/authorization-2功能/授权-2
feature/authorization-with-error功能/授权错误
Remote repo branches:远程仓库分支:
feature/authorization-2功能/授权-2
And I want to have only local branch which is on remote repo: feature/authorization-2而且我只想拥有远程仓库上的本地分支:feature/authorization-2
git branch --merged
you can skip some important branches你可以跳过一些重要的分支
git branch --merged| egrep -v "(^\*|master|main|dev|skip_branch_name)"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.