I know what to do when I get that "! [rejected] develop -> develop (non-fast-forward)" error message after a git push origin develop
(git pull --rebase
works for me), so that's not what I'm asking, but when I'm in a hurry sometimes I can miss that error message and the change I meant to push sits on my local machine until someone asks why my new feature doesn't seem to be working.
So, is there a way to configure git
(or bash
) so that I can highlight the error (or even pop-up a message box) whenever it occurs?
For example, this demonstrates what I might want to see:
# Instead of "git push origin develop" simulate the error
echo "! [rejected] develop -> develop" | \
ack --passthru --color-match=bright_red "\[rejected]"
I would want to keep using just git push origin develop
as I'm quite likely to forget to use git-push-with-highlight origin develop
or whatever.