git branch-cleanup
Do you find yourself staring at a mess when you type git branch
. Cleanup after yourself with ease with this git alias.
git branch-cleanup
Will delete any local branches that have already been merged as well as prune remote branches that have been deleted from your origin repo.
Add to .gitconfig
...
[alias]
branch-cleanup = !sh -c 'git branch --merged | grep -v master | xargs git branch -d && git remote prune origin'
Written by Robin Curry
Related protips
1 Response
Nice one :) I added this to my cheat sheet. This can be very helpful. (https://github.com/obstschale/gitCS#git-branch-cleanup)
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Alias
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#