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

10 lines
288 B
Bash
Executable File

#!/bin/sh
git-l ||
{ test -e $(git rev-parse --git-path rebase-merge) &&
printf "\e[31;1mError - aborting rebase!\e[0m\n" >&2 &&
git rebase --abort; }
if git rev-parse @{upstream} >/dev/null 2>&1
then git push --recurse-submodules=on-demand "$@"
else git push --set-upstream "$@"
fi