> ## Documentation Index
> Fetch the complete documentation index at: https://bazable.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# bazable hook

> Install a pre-push Git hook

Installs a **pre-push Git hook** that runs `bazable inspect` before every `git push`. If contract violations are found, the push is blocked and the developer must fix them before pushing.

## Usage

```bash theme={null}
bazable hook
```

## Options

<Info>
  This command takes no options.
</Info>

## What it does

<Steps>
  <Step title="Create the hook">
    Creates (or overwrites) the file `.git/hooks/pre-push` in your repository.
  </Step>

  <Step title="Run inspect on push">
    The hook script runs `bazable inspect` automatically before every `git push`.
  </Step>

  <Step title="Block or allow">
    If `bazable inspect` exits with a non-zero code (violations found), the push is aborted with a clear message. Otherwise the push proceeds normally.
  </Step>
</Steps>

## Skipping the hook

To temporarily bypass the check, set the environment variable `BAZABLE_SKIP=1` before pushing:

```bash theme={null}
BAZABLE_SKIP=1 git push
```

<Note>
  Useful in emergencies or when you need to push a known-broken contract quickly.
</Note>

## Prerequisites

* Your project must be a Git repository (run `git init` if needed).
* Your project must contain a valid `bazable.config.json`.

## Example

```bash theme={null}
cd my-project
bazable hook
# Bazable Git hook installed! 'bazable inspect' will now run automatically before every git push.
```

<Warning>
  Pre-push hooks live in `.git/hooks/` and are not committed. Every teammate must run `bazable hook` in their own clone.
</Warning>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.