function delete-branches() {
git branch |
grep --invert-match '\*' |
cut -c 3- |
fzf --multi --preview="git log {} --" |
xargs --no-run-if-empty git branch --delete --force
}
This is really slick.
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
function delete-branches() {
git branch |
grep --invert-match '\*' |
cut -c 3- |
fzf --multi --preview="git log {} --" |
xargs --no-run-if-empty git branch --delete --force
}
This is really slick.
Those of you reading this might also be interested in two_percent, which is a fork of skim
, which in turn is a Rust implementation of fzf. two_percent is faster, more efficient and uses less memory than fzf
, which is especially noticeable with large inputs.
My most direct use of fzf is to search large result sets for something I can't 100% remember the name or location of, so this actually sounds nice. I've managed to get fzf to slow down a few times and... well, I'm sure as hell not organizing that folder structure.
But y 2% instead of skim?
What's the difference between two_percent and skim?
It's faster and more memory efficient basically. skim also appears to have been abandoned (no updates in over an year), whereas two_percent is being actively developed.