I'm looking to share what I've done and potentially get improvements on this code snippet from others - my pre-push hook for pushing to ftp:
$ code .git/hooks/pre-push
Works like a charm, but I'd love to not push unless I know there are no unmerged changes I should pull. I'm not sure how to do that. I know, if there are changes, a git hook should do exit 1
to abort the git push.
I searched around for a post-push hook but that proved to be a much more daunting task, because git does not have a post-push hook.