git commit in pre-push hook
I have added something like that in pre-push hook: gs0=$(git status) pip-dump gs1=$(git status) if [ "gs0" != "gs1" ] then git commit -m "pip-dump" fi (this is updating my pip requirements file) It seems that the push is not pushing the new commit, but the one which the HEAD was on at the beginning of the script. How to fix that? You can't: the push command figures out which commits to push before invoking the hook, and pushes that if the hook exits 0. I see three options: Exit nonzero, telling the user "push rejected because I added a commit" Exit zero, telling the user "push went through but