Delete Merged Branches with git
It's common courtesy to keep your git branch list clean, especially when colleagues need to fetch your remote branches. I'm a bit of a ... offender, when it comes to maintaining my git branch list. My colleague John Karahalis is not, however, and he hooked me up with an awesome git alias for deleting branches that have been merged into master. Place the following within your .git/config
file:
[alias]
delete-merged-branches = "!f() { git checkout --quiet master && git branch --merged | grep --invert-match '\\*' | xargs -n 1 git branch --delete; git checkout --quiet @{-1}; }; f"
You can run this command via:
git delete-merged-branches
The script worked masterfully -- all branches merged into master were gone and I was left to evaluate which local branches were left to send pull requests for. Beautiful. Keep this around if you're a lazy git-ter like me!
![Animated 3D Flipping Menu with CSS]()
CSS animations aren't just for basic fades or sliding elements anymore -- CSS animations are capable of much more. I've showed you how you can create an exploding logo (applied with JavaScript, but all animation is CSS), an animated Photo Stack, a sweet...
![I’m an Impostor]()
This is the hardest thing I've ever had to write, much less admit to myself. I've written resignation letters from jobs I've loved, I've ended relationships, I've failed at a host of tasks, and let myself down in my life. All of those feelings were very...
![Create GitHub-Style Buttons with CSS and jQuery, MooTools, or Dojo JavaScript]()
I'm what you would consider a bit of a GitHub fanboy. We all know that GitHub is the perfect place to store repositories of open source code, but I think my love of GitHub goes beyond that. GitHub seems to understand that most...
![Create a Download Package Using MooTools Moousture]()
Zohaib Sibt-e-Hassan recently released a great mouse gestures library for MooTools called Moousture. Moousture allows you to trigger functionality by moving your mouse in specified custom patterns. Too illustrate Moousture's value, I've created an image download builder using Mooustures and PHP.
The XHTML
We provide...
Nice tip – thanks
Thanks, very handy. Also found this https://gist.github.com/malclocke/943565 to do the same for all merged remote branches.
Also note that you can prune remote-tracking references (e.g., remotes/foo/patch-1) with either
fetch --prune foo
orremote prune foo
.