dotfiles/files/bin/git-retroamend

18 lines
296 B
Plaintext
Raw Normal View History

2023-07-28 17:47:59 +01:00
#!/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^