diff --git a/files/bin/git-retroamend b/files/bin/git-retroamend new file mode 100755 index 0000000..0f5e615 --- /dev/null +++ b/files/bin/git-retroamend @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# Based on https://github.com/no-gravity/git-retroamend + +set -e + +hash=$1 + +if [[ ! -v hash ]]; then + echo "Please provide hash." + exit 1 +fi + +git commit --fixup $hash + +# 'GIT_EDITOR=true' makes the rebase non-interactive +GIT_EDITOR=true git rebase -i --autosquash $hash^