dotfiles/.local/bin/scripts/git-ready

9 lines
360 B
Bash
Executable File

#!/bin/sh
# Interactive rebase onto the given committish, the matching upstream branch
# or the first named ref from the history if there is no upstream yet.
if test $# -gt 0
then remote="$1"; shift
else remote=$(git rev-parse --verify --quiet @{push} || git rev-parse $(git describe --all HEAD~ | sed 's/-[^-]*-[^-]*$//'))
fi
git rebase -i "$remote" "$@"