You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
270 B
Bash

function _branches() {
if [ -n "$1" ]; then
echo "$1"
return
else
git for-each-ref --sort=committerdate refs/heads/ | awk -F'heads/' '{ print $NF }' | fzf
fi
}
function cb() {
branch=$(_branches)
git checkout "${branch}"
}