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

# Git Hooks

Qlty can be integrated into git using git hooks to ensure:

1. code is formatted before committing (pre-commit hook)
2. code meets quality standards before pushes (pre-push hook)

## Installation

Installation is easiest using the Qlty CLI.

1. First [Install Qlty](https://docs.qlty.sh/cli/quickstart).
2. Run:

```sh lines theme={"system"}
qlty githooks install
```

See the [hook files](https://github.com/qltysh/qlty/tree/main/qlty-cli/src/commands/githooks) to understand what will be installed or to perform manual installation.

## Pre-push

The Git pre-push hook will ensure that files are auto-formatted before pushing.

If there are files that are formatted incorrectly, it will format them and generate a new commit.

Due to the way Git works, when this occurs, you will need to run `git push` again.

<Note>You can always run `git push --no-verify` to skip the pre-push hook.</Note>
