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

9 lines
364 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-05-31 16:48:58 +00:00
else remote=$(git rev-parse --verify --quiet @{push} || git rev-parse $(git describe --all HEAD~ | rev | cut -d '-' -f3- | rev))
2021-05-06 06:29:05 +00:00
fi
git rebase -i "$remote" "$@"