Created
September 4, 2018 20:23
-
-
Save Brantron/1bd191d3bddd9107c2ce8370f7e330ae to your computer and use it in GitHub Desktop.
an interactive git branch selector for fzf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias branchlist="git for-each-ref --sort='-authordate' --format='%1B[0;34m%(refname:short)%1B[m ===> %1B[1;35m%(subject)' refs/heads | sed -e 's-refs/heads/--'" | |
function branches() { | |
local branch_name=$(branchlist | fzf --ansi -m) | |
if [[ $branch_name ]]; then | |
echo $branch_name | awk '{print $1}' | xargs git co | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Perfect! Just missed the
co
alias setup! This is excellent :)