#!/usr/bin/env bash usage() { local error="$1" cat >&2 < Error: -> $error EOF exit 1 } args="$@" if [[ -z "$args" ]]; then usage "No arguments specified." fi REV=$1 PR=$2 TARGET=$(echo $REV | sed s_origin/__) MERGE_MSG="Merge branch '$TARGET' (#$PR)" git merge --no-ff --signoff --log -m "$MERGE_MSG" $REV