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

9 lines
360 B
Plaintext
Raw Normal View History

2020-12-12 15:51:14 +00:00
#!/bin/sh
2021-05-06 06:29:05 +00:00
# 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
2021-11-04 11:23:32 +00:00
else remote=$(git rev-parse --verify --quiet @{push} || git rev-parse $(git describe --all HEAD~ | sed 's/-[^-]*-[^-]*$//'))
2021-05-06 06:29:05 +00:00
fi
git rebase -i "$remote" "$@"