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
1 changed files with 17 additions and 0 deletions

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^