function b() { local branches branch branches=$(git for-each-ref --sort=-committerdate refs/heads/ --format="%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:blue)%(contents:subject)%(color:reset) %(color:green)(%(committerdate:relative))%(color:reset) [%(color:red)%(authorname)%(color:reset)]") \ && branch=$(echo "$branches" | fzf --ansi --no-sort) \ && branch=$(echo "$branch" | awk '{print $1}' | sed 's/\* //') \ && git checkout "$branch" } function db() { local branches branch branches=$(git for-each-ref --sort=-committerdate refs/heads/ --format="%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:blue)%(contents:subject)%(color:reset) %(color:green)(%(committerdate:relative))%(color:reset) [%(color:red)%(authorname)%(color:reset)]") \ && branch=$(echo "$branches" | fzf --ansi --no-sort) \ && branch=$(echo "$branch" | awk '{print $1}' | sed 's/\* //') \ && [[ "$branch" != "master" ]] && git branch -D "$branch" || echo "Cannot delete master branch" }