Skip to main content
When to use it.
  • You want a broken push to stop on your machine, before it starts a CI run
  • Your agent pushes on its own and you want its tests checked every time

Turn it on

From the root of the git repository

box setup --pre-push, then a git push stopped because a test fails

What a push looks like

Job bj_n7nWHXFKLvrVHlyS on the production Mac: 60 s billed, $0.05
With a failing test the push stops after the FAIL lines shown on the Test page, with this line, and nothing reaches the remote

How it behaves

  • Failing tests stop the push (exit 1). Fix them and push again
  • git push --no-verify skips the hook once
  • A push that only deletes branches runs nothing
  • The hook lives in this repository’s .git/hooks only, never in your git config. A pre-push hook that is not box’s is left alone; with husky or lefthook, add box test to their pre-push hook instead