Cette page est affichée en anglais. Une traduction française est en cours.
ConfigsJul 21, 2026·2 min de lecture

no-mistakes — Git Push Safety Guard

Lightweight CLI tool that prevents accidental git pushes by enforcing pre-push checks, branch protection rules, and confirmation prompts.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
no-mistakes
Commande d'installation directe
npx -y tokrepo@latest install c0640919-8523-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

no-mistakes is a lightweight Go CLI that wraps git push with configurable safety checks. It prevents common mistakes like pushing to protected branches, pushing uncommitted changes, or force-pushing without confirmation, acting as a guardrail for teams and solo developers.

What no-mistakes Does

  • Intercepts git push and runs configurable pre-push validations
  • Blocks pushes to protected branches (main, master, production)
  • Requires confirmation for force pushes and branch deletions
  • Validates commit messages against configurable patterns
  • Checks for uncommitted changes and untracked sensitive files

Architecture Overview

no-mistakes installs as a git hook wrapper in Go. When a push is initiated, it intercepts the command, runs the configured validation chain, and either allows or blocks the operation with a clear error message. Configuration is stored in a project-level YAML file or global config, and the tool operates entirely locally with zero network dependency.

Self-Hosting & Configuration

  • Install via go install or download a pre-built binary
  • Run no-mistakes init in a repository to set up git hooks
  • Configure protected branches in .no-mistakes.yaml at the repo root
  • Global rules can be set in ~/.config/no-mistakes/config.yaml
  • Works alongside existing git hooks without conflicts

Key Features

  • Zero-dependency single binary written in Go
  • Protects against accidental pushes to sensitive branches
  • Configurable commit message validation patterns
  • Force-push confirmation with explicit acknowledgment
  • Sensitive file detection (prevents pushing .env, credentials)

Comparison with Similar Tools

  • Husky — JS git hooks manager; no-mistakes is language-agnostic and focused on push safety
  • pre-commit — general hook framework; no-mistakes is specialized for push protection
  • Lefthook — fast hook runner; no-mistakes adds branch protection and sensitive file detection
  • git-secrets — AWS secret scanning; no-mistakes covers broader push safety beyond secrets

FAQ

Q: Does it work with all git hosting platforms? A: Yes, it operates at the local git level and is platform-agnostic.

Q: Can I bypass the checks in an emergency? A: Yes, an explicit flag allows bypassing with a warning logged.

Q: Does it slow down normal pushes? A: Checks run in milliseconds; there is no noticeable delay for standard pushes.

Q: Can teams share configuration? A: Yes, commit .no-mistakes.yaml to the repository for shared team rules.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires