主要命令
git branch | grep -v "master" | xargs git branch -D
注意点
- 执行前需要切换到master分支执行
- 当前分支未做修改
增强命令
git stash && git checkout master && git branch | grep -v "master" | xargs git branch -D
git branch | grep -v "master" | xargs git branch -D
git stash && git checkout master && git branch | grep -v "master" | xargs git branch -D
[alias]
recom = commit --amend
diffh = diff HEAD
diffhh = diff HEAD^
cbran = rev-parse --abbrev-ref HEAD
cancel = reset --soft HEAD^
cpush = !git push origin `git cbran`
cpull = !git pull origin `git cbran`
fpull = !git fetch origin `git cbran` && git reset --hard origin/`git cbran`
slog = log --pretty=format:'%C(yellow)[%ad] %C(green)%h %Creset: %s' --date=iso
delete-brans = !git branch --merged | grep -v \\* | grep -v 'master\\|release' | xargs -I % git branch -d %