5 ms·
fzf is a wonderful little tool. I use this script so much: git branch | fzf | xargs git checkout
by AmpsterMan 5y ago
fzf is a wonderful little tool. I use this script so much:
git branch | fzf | xargs git checkout
- omair_inam 5y agoExcuse my ignorance, but what does this command do?
- _bohm 5y agoIt pipes a list of available git branches into fzf, which lets you filter them by fuzzy string match. When you hit enter, it will take the best matching one and switch to that branch
- omair_inam 5y ago_ ._ _ , _ ._ (_ ' ( ` )_ .__) ( ( ( ) `) ) _) (__ (_ (_ . _) _) ,__) `~~`\ ' . /`~~` ; ; / \ _____________/_ __ \_____________
- deleted 5y ago[deleted]
- bloopernova 5y agoRelated git+fzf: [alias] fza = "!git ls-files -m -o --exclude-standard | fzf -m --print0 | xargs -0 git add" Then if you run "git fza" you'll get a list of changed files in your repo, which you can use TAB to select/deselect. Hit enter and the selected files will be staged, ready for a commit. Extra cool is that it works from any subdirectory of your repo because it always lists files from the root of the repository. It's really useful for selectively adding lots of files from the command line. I then alias "ga" to "git fza" for even less typing :)