A recorded run where a commit with planted leaks is refused and no commit is written, the counts from the hook's self-test, and the cases a local hook does not cover: a skipped hook, a fresh clone, a commit made elsewhere, old history, unknown shapes.仕込んだ痕跡つきの commit が断られ、commit が1つも書かれなかった実行の記録、フックの自己試験の数、そして手元のフックが及ばない場合(飛ばされたフック、新しい複製、別の場所で作られた commit、過去の履歴、知らない形)。
A pre-commit hook is a program in the repository's hooks folder on your machine. Git runs it after git commit is called and before the commit is written. If the program exits with a code other than 0, Git writes no commit. That is the whole mechanism: what gets refused is decided by the check inside the program.pre-commit フックは、手元のリポジトリのフック用フォルダにあるプログラムです。Git は、git commit が呼ばれた後、commit を書く前にそれを実行します。プログラムが 0 以外の終了コードを返すと、Git は commit を書きません。仕組みはこれだけで、何が断られるかは、プログラムの中の検査が決めます。
Run of 2026-11-12 08:59 +0000 on zero-trace-ship-kit-full-v1.1.4.zip: with three leaks planted in the folder (a home path with a login name, a photo with a GPS position, a wallet recovery phrase), git commit ended with exit code 1 and 3 findings. The next command counted the commits recorded so far: 0. After the three were fixed, the same command ended with exit code 0 and the commit was written. The last two lines of the refusal:2026-11-12 08:59 +0000 の実行(対象 zero-trace-ship-kit-full-v1.1.4.zip):フォルダに痕跡を3つ仕込んだ状態(ログイン名入りのホームのパス、位置情報つきの写真、ウォレットの復元フレーズ)で、git commit は終了コード 1・検出 3 件で終わりました。続くコマンドで、記録された commit を数えると 0 でした。3つを直した後、同じコマンドは終了コード 0 で終わり、commit が書かれました。断られた時の最後の2行:
result: FOUND 3 file(s) · NONE FOUND WITHIN SUPPORTED SCOPE 40 · OUT OF SCOPE 0 · UNREADABLE 0
zero-trace gate: BLOCKED — 3 finding(s) · 43 files · 0 archive members · 2 private terms · 383 ms
The same check runs against planted samples on every release. Reading of 2026-11-18 22:40:16 +0000: 32 of 32 planted samples detected, and 0 findings on 17 clean look-alikes. These are samples we planted ourselves, in shapes the check is written for. It is not a detection rate for real repositories.同じ検査を、公開のたびに、仕込んだ検体に対して走らせています。2026-11-18 22:40:16 +0000 の読み:仕込んだ検体 32 件のうち 32 件を検出、よく似た無害な検体 17 件での検出は 0 件。これは当方が自分で仕込んだ、検査が対応している形の検体です。実際のリポジトリでの検出率ではありません。
1) A commit made with the commit option that skips the pre-commit and commit-msg hooks: Git then does not run the program at all. 2) Another clone: cloning does not copy the hooks of the repository it came from, so a fresh clone runs your hook only after someone installs it there (a machine-wide core.hooksPath or a template folder can supply hooks of its own). 3) A commit made somewhere else, such as a web editor or another machine: your hook never runs for it. 4) What is already in history: a hook reads what its program selects, and the one in this record reads the content being committed; history is read only when a run asks for it. 5) Shapes the check does not know: a key in a format it has no pattern for, free-form confidential text, text inside an image.1) pre-commit と commit-msg のフックを飛ばす指定を付けた commit:Git はプログラムをそもそも実行しません。2) 別の複製:clone は、元のリポジトリのフックを写しません。新しく clone した場所であなたのフックが動くのは、誰かがそこに入れた後です(端末全体の core.hooksPath やひな形のフォルダが、別のフックを与えていることはあります)。3) 別の場所で作られた commit(ウェブ上の編集画面、別の端末など):あなたのフックは一度も動きません。4) すでに履歴にあるもの:フックが読むのは、プログラムが選んだ範囲です。この記録のフックが読むのは、commit しようとしている内容で、履歴は、そう指定した実行でだけ読みます。5) 検査が知らない形:型を持っていない形式の鍵、形の決まらない機密の文章、画像の中の文字。
If core.hooksPath is set, Git reads hooks from that folder instead of .git/hooks. A hook file that is missing or not executable is not run, and Git does not warn about a missing one. If the first command prints a folder, look there instead of .git/hooks.core.hooksPath が設定されていると、Git は .git/hooks ではなく、そのフォルダからフックを読みます。ファイルが無い、または実行できない場合、フックは動きません。無いことを Git は知らせません。1行目のコマンドがフォルダを出したら、.git/hooks ではなく、そのフォルダを見てください。
git config --get core.hooksPath # empty: Git reads .git/hooks
ls -l .git/hooks/pre-commit .git/hooks/pre-push # or the same two names in the folder printed above
A pre-push hook can check commits that were made with pre-commit skipped on the same clone, at the moment they are about to leave it, if its program is written to read them (a push has a skipping option of its own). A check in CI runs on the server for the pushes its configuration is set to react to, whichever clone or editor the commit came from, as long as the workflow is enabled; it reports after the push has arrived, so a secret it finds has already left your machine and the key still has to be revoked. None of the three reads shapes it has no pattern for.pre-push フックは、同じ複製で pre-commit を飛ばして作られた commit を、外へ出る直前に検査できます。プログラムがそれを読むように書かれている場合です(push にも、飛ばす指定があります)。CI の検査は、どの複製や編集画面から来た commit でも、設定で対象にした push に対して、サーバーの側で走ります(ワークフローが有効な間)。ただし報告は push が届いた後なので、そこで見つかった秘密はすでに手元を離れており、鍵の失効は要ります。3つのどれも、型を持っていない形は読みません。
Yes, on purpose: Git has a commit option that skips the pre-commit and commit-msg hooks, and anyone with write access to the clone can also remove the file. A hook is a gate against ordinary mistakes on that clone, not an access control.意図すれば越えられます。Git には pre-commit と commit-msg のフックを飛ばす commit の指定があり、その複製に書き込める人はファイルを外すこともできます。フックは、その複製でのふつうの間違いに対する関所で、権限の管理ではありません。
No. Hooks are not copied by clone. Each clone needs an install step, or a committed hooks folder that each person points core.hooksPath at; either way it is a step someone has to take.持ちません。フックは clone で写りません。複製ごとに入れる手順が要ります。フックのフォルダを commit しておき、各自が core.hooksPath をそこへ向ける方法もありますが、どちらも誰かが行う1手です。
If the hook ran and finished, it means the check reported none of the supported shapes in the content it read. It is not proof that nothing is there.フックが動いて最後まで終わったなら、読んだ内容に、対応済みの型が報告されなかったという意味です。何も無いことの証明ではありません。
Written with AI assistance (Claude). The figures are measured or computed as named on the page. The commands are examples: read them and adapt them to your repository before running. Product links lead to our own paid kits.AI(Claude)の補助を使って書いています。数字は、ページに記したとおりの実測値か計算値です。コマンドは例です。実行の前に読み、自分のリポジトリに合わせて直してください。商品のリンク先は、当方の有料のキットです。
Free tools and records:無料の道具と記録: Paste-Guard Live · Live Ledger実験台帳
ZEUS LAB is an independent software verification and development studio. It is not affiliated with any payment processing company of a similar name, or with any other company or service.※ZEUS LAB は独立したソフトウェア検証・開発スタジオであり、同名の決済代行会社および他社サービスとは一切関係ありません。