Modernizing Your Dev Stack: Re-engineering Git Hooks with prek


Modernizing Your Dev Stack: Re-engineering Git Hooks with prek

j178/prek

2026-02-08

Enter prek (by j178). It’s essentially a high-performance alternative to the classic Python-based pre-commit framework, rebuilt from the ground up in Rust.

As engineers, we love speed and minimal dependencies. Here’s why prek is a step up

Blazing Fast
Being written in Rust, it starts up and executes much faster than the Python implementation. This is crucial because "hook lag" is the number one reason devs start using --no-verify.

Single Binary
No need to worry about whether your teammate has the right Python version or virtualenv set up just to run a linter.

Compatibility
It’s designed to be a drop-in or near-drop-in replacement, so you don't have to relearn everything.

Setting it up is straightforward. Since it's a Rust tool, you can grab it via cargo or direct download.

# Using cargo
cargo install prek

# Or using homebrew (if available/configured)
brew install j178/tap/prek

Navigate to your project root and run

prek install

This sets up the necessary script in .git/hooks/pre-commit that tells Git to look at your prek configuration.

prek uses a .pre-commit-config.yaml file, just like the original framework. This makes migration a breeze.

Here is a sample configuration that runs a formatter (Prettier) and a linter (ESLint/Rust) before every commit

repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.5.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer

  - repo: https://github.com/pre-commit/mirrors-prettier
    rev: v3.1.0
    hooks:
      - id: prettier
        stages: [commit]

  # Example for a Rust project
  - repo: local
    hooks:
      - id: rust-fmt
        name: fix rust formatting
        entry: cargo fmt --all --
        language: system
        types: [rust]

If you want to check all files without committing

prek run --all-files

CI/CD Integration
You can use prek in your CI pipeline to ensure that the code being merged follows the same rules being enforced locally.

Language Agnostic
Even though it’s built in Rust, it can manage hooks written in Node, Python, Go, or simple Shell scripts.

Skip with Intention
If you ever need to bypass it for a quick experimental commit, the standard git commit -m "..." --no-verify still works!


j178/prek




Deep Dive into jj-vcs/jj: Modern Version Control for Engineers

Think of jj as a modern take on version control that aims to address some of the complexities and pain points often associated with Git


A Developer's Quickstart Guide to GitHub: From Commits to Pull Requests

Think of GitHub as the central hub for collaboration on code. Even if you're a solo developer, mastering GitHub is essential


From Hallucinations to High-Quality Code: The Git-mcp Approach

Git-mcp can benefit software engineers in several waysHigher Quality AI-Generated Code By using the project's actual code as context


Streamline Your Development: Why GitButler is the Next Gen Git Client for Pros

Let’s dive into GitButler, a tool that’s trying to rethink how we interact with version control.Think of GitButler as a "Virtual Branch" manager


Finding Secrets with Gitleaks: A Deep Dive for Developers

Gitleaks is a command-line tool that helps you find secrets in your Git repositories. What kind of secrets? Think passwords


Why Lazygit is Your New Best Friend in the Terminal

Lazygit is a simple terminal UI (User Interface) for Git commands. Instead of typing out long, complicated Git commands