Skip to content
masterclass Buddy

Git · Option

pre-push hook

The pre-push hook runs during git push before Git transfers objects. It can inspect proposed reference updates and stop the push by returning a non-zero status.

Last updated

Syntax

$GIT_DIR/hooks/pre-push <remote-name> <remote-location>

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • git push
  • pre-receive
  • update
  • pre-commit
  • post-merge
  • pre-auto-gc

Source: Git - githooks Documentation. Checked 2026-11-03.