Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fbr () {
- local branches branch
- local query=$1
- local opts="--cycle +m -e --color=spinner:233,info:233 --select-1 --exit-0 --preview-window down:10 --height 50%"
- if ! [[ -z "${query// }" ]]
- then
- opts="$=opts -q ${query}"
- fi
- branches=$(git branch) && branch=$(echo "$branches" | fzf "$=opts" --preview 'git --no-pager log --oneline --decorate --graph -n10 {1}') && git checkout $(echo "$branch" | awk '{print $1}' | sed "s/.* //")
- }
Advertisement
Add Comment
Please, Sign In to add comment