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!
I spent a few months experimenting with different approaches for writing simple, elegant and maintainable media queries with Sass. Each solution had something that I really liked, but I couldn't find one that covered everything I needed to do, so I ventured into creating my...
Back in late 2012 it was not easy to find open source projects using requestAnimationFrame()
- this is the hook that allows Javascript code to synchronize with a web browser's native paint loop. Animations using this method can run at 60 fps and deliver fantastic...
Waveform images are an awesome addition to boring audio widgets. They can be functional as well as aesthetically pleasing, allowing users to navigate audio visually. I recently found wavesurfer.js, an amazing waveform image utility that uses to Web Audio API to create super customizable...
I'm back! David asked me to rope up some of my favorite stuff on CodePen again, which I both love doing, and wince at the thought of having to pick so few favorites. I like a ton of stuff on...
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
.