How can I make a script run instantly on `git push` without waiting for network?

The pre-push hook waits for network/internet communications with the remote to complete before running. So it starts up very late, it takes over 2 seconds for pre-push to start running after pressing enter on git push command lines in my current project.

Is there a way that I can make commands like git push, git push --force etc., all INSTANTLY run a shellscript, just for one project?

Posted Mar 5, 2026, 2:25 AM UTC

1215
Loading comments…