Skip to content

Instantly share code, notes, and snippets.

@meyer9
Created August 17, 2020 19:28
Show Gist options
  • Save meyer9/90cc09cc2b35f008cb6fb1126f5fdb23 to your computer and use it in GitHub Desktop.
Save meyer9/90cc09cc2b35f008cb6fb1126f5fdb23 to your computer and use it in GitHub Desktop.
fbr.sh - Find a branch by name/author/time
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