After cloning, files under `secrets/` are binary gibberish, and after unlocking they show as modified forever.
Likely causes → The repo uses a clean/smudge filter (git-crypt or similar) declared in .gitattributes. Without the key and filter config, you see the encrypted blobs. The "always modified" state happens when files were committed before the .gitattributes filter rule existed, so the stored blob does not match what the clean filter produces.
Diagnose →
git check-attr filter diff -- secrets/db.env
git config --get-regexp '^filter\.'
git-crypt status -e
Fix → Unlock with the shared key or your GPG identity (git-crypt unlock /path/to/keyfile). For files that were committed in plaintext, re-add them through the filter and commit:
git add --renormalize secrets/
git commit -m "Encrypt secrets via git-crypt"
Note that the plaintext remains in history — rotate those secrets.
Prevent → Add the filter rule before adding secret files, run git-crypt status in CI, and prefer an external secrets manager or SOPS for anything production.