#!/bin/sh set -e commit=$(git log master --grep=trunk@$1 -p | head -n1 | cut -f2 '-d ') git cherry-pick $commit git commit --amend