I would like to run a compression script before git push such that anytime a user tries to push changes to a remote repository, it checks for uncommitted change
git push
Take a look at this patch.
See .git/hooks/ in your repo for sample hooks, maybe you will see some alternative.
.git/hooks/