git批量删除已合并的远程分支
# Make sure remotes are up to date (with stale remotes purged): # 先执行远程获取 git fetch -p # Initial no-op run --- do the branches to delete look correct? # Be careful to omit 'master' from the output. # grep -v 用于排除关键字,检查此命令输出的branch名字是否合理,调整次命令直至筛选出需要删掉的branch # "git branch --remote"每行输出以“origin/”开头,命令"cut -b 10-"用于删除此前缀 git branch --remote --merged origin/master | grep -v 'master' | cut -b 10- | xargs # Do the bulk delete!!! (can take a long time...) # 执行远程删除,务必确保之前的待删除branch筛选合理! git branch --remote --merged origin/master | grep -v 'master' | cut -b 10- | xargs git push --delete origin
相关推荐
lljhi0 2020-07-21
huangchunxia 2020-07-08
nebulali 2020-07-05
formula 2020-11-12
huhongfei 2020-11-05
乾坤一碼農 2020-10-27
liumengyanysu 2020-10-22
E哥的aws认证攻略 2020-10-15
tianyafengxin 2020-10-08
guying 2020-10-05
好脑筋不如烂笔头 2020-09-17
nebulali 2020-09-11
佛系程序员J 2020-09-15
fenggit 2020-09-15
JustHaveTry 2020-09-11
兄dei努力赚钱吧 2020-09-06
IngeniousIT 2020-08-25