Created
August 17, 2020 19:28
-
-
Save meyer9/90cc09cc2b35f008cb6fb1126f5fdb23 to your computer and use it in GitHub Desktop.
fbr.sh - Find a branch by name/author/time
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
fbr() { | |
local branches branch | |
branches=$(git for-each-ref --sort=-committerdate --sort=-author --format "%(refname:lstrip=-1) - %(authorname)" --color=always refs/heads) && | |
branch=$(echo "$branches" | fzf +s +m -e) && | |
git checkout $(echo "$branch" | sed "s: - .*::") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment