# Protect your commits

[← Back to Quickstart](https://dotenvx.com/docs/quickstart.md#commit)

Block accidental plaintext secrets from entering your commits. Run once:

```console
$ dotenvx protect
⛉ protection: full (.env*, .env.keys*)
```

Dotenvx checks env files before Git stages them. Encrypted files pass through; unencrypted secrets are blocked, even with git add -f.

Protection applies to existing and future repositories for your Git user on this machine.

[Read more about protect →](https://dotenvx.com/docs/cli/protect/)
