#!/bin/bash # Helper to rewrite all local branches. rb_one() { local b=$1 shift printf "${BRACKET}### ${GREEN}${b}${NORMAL}" if ! git config --local "branch.${b}.merge" >/dev/null; then echo " -> skipping due to missing merge branch" else echo git checkout -q "${b}" || return git rebase "${opts[@]}" | sed -e '/^Fast-forwarded/d' -e "s:^:${BAD}:" -e "s:$:${NORMAL}:" if [[ ${PIPESTATUS[0]} -ne 0 ]] ; then git rebase --abort fi fi } usage() { cat <