Hacker News new | past | comments | ask | show | jobs | submit login

Sure! Using Fish shell run the code below. abbr creates and abbreviation (slightly different from an alias and imho much more useful), see https://fishshell.com/docs/current/cmds/abbr.html

My git checkout abbr requires git,fzf to be installed

abbr --add ck 'git branch -a | string replace -a \'origin/\' \'\' | string replace -a \'remotes/\' \'\' | sort -u | fzf | read branch; git checkout $branch'

To use just type ck and then you can narrow the branch list by typing some letters, then arrow keys to select the branch hit enter, boom.




This is awesome, thanks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: