Add retroamend script

This commit is contained in:
Jake Howard 2023-07-28 17:47:59 +01:00
parent fc557f00d3
commit ff9cb9b3a6
Signed by: jake
GPG key ID: 57AFB45680EDD477

17
files/bin/git-retroamend Executable file
View file

@ -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^