home/git: add rebase-fixups script

This commit is contained in:
2024-11-13 16:57:00 +01:00
parent a5cad921ff
commit 84c9562bfc
2 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
if [ -n "${1:-}" ]; then
TARGET_BRANCH="$1"
shift
else
TARGET_BRANCH=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')
fi
FORK_POINT=$(git merge-base --fork-point "$TARGET_BRANCH")
git rebase "$FORK_POINT" --autosquash "$@"