DocsWhen something goes wrong
Recovery
Start with SecretSleuth status. It lists every problem it can see in protected files, each next to the command that fixes it.
My edit doesn’t show in git status, or git add fails
The file is protected with skip-worktree (see How it works). Commit the edit with stage:
SecretSleuth stage --file appsettings.json # or: stage --all
git diff --cached # only your lines changed
git commit -m "Add feature flag"
It refuses when an edited line still holds a placeholder (you renamed "Password": "DO_NOT_COMMIT_PASSWORD"; there is no committed value to put back on that line, so replace the placeholder with a safe value or undo the change), or when an edited line looks like a new secret (move it to user secrets or a vault and commit a reference).
The staged copy carries the secret values already in HEAD. Nothing new is exposed, but they stay in the branch until remediated.
pull or branch-switch refused: protected files have local changes
To switch, protected files are first put back to their committed content. That would throw away your edits, so the command stops and changes nothing. Either keep them (stage --all, git commit, re-run) or drop them (re-run with --discard-local-edits).
Plain git pull or checkout failed: “Your local changes … would be overwritten”
skip-worktree did its job: git refused to put the real secrets back over your placeholders. Don’t fight it with git update-index by hand:
SecretSleuth pull # same branch
SecretSleuth branch-switch --to <branch> --pull # other branch
branch-switch stopped at git stash pop with conflicts
Only your genuine, non-obfuscation changes go through the stash, so this is a real conflict between your work and the branch. Resolve it like any git stash pop conflict (git status, fix the files, git add, git stash drop), then re-protect with SecretSleuth --full-scan.
A commit is blocked: “contains a DO_NOT_COMMIT_ placeholder”
[IronForge Secret Sleuth] BLOCKED: appsettings.json contains a DO_NOT_COMMIT_ placeholder
A placeholder is staged, usually because the file was unfrozen and added with git add.
- To commit your own edits:
git restore --staged <file>, thenSecretSleuth stage --file <file>. - To commit the remediation: replace each placeholder with a safe value (
'', an env var name, a Key Vault URI) first.
git commit --no-verify bypasses the hook. Don’t, unless you have checked the staged content yourself.
The post-merge hook warned a secret may have been restored
A merge wrote real values into a protected file, typically after it was unfrozen by hand. Re-seal it: SecretSleuth --full-scan.
I scanned by mistake, or want to undo everything
SecretSleuth restore --all --remove-hooks
Puts every protected file back to its committed content, clears the skip-worktree flags, copies untracked files back from their backups, and removes the hooks (restoring any hook they replaced). Files holding your own edits are refused rather than overwritten; stage and commit them first, or add --discard-local-edits. The manifest is kept.
I lost the real values in a file
- Tracked file: they are in
HEAD.SecretSleuth restore --file <path>. - Untracked file: the scan backed it up under
~/.ironforge-secretsleuth/backups/<repo-hash>/<timestamp>/.restore --allcopies it back. Delete those backups once the values are in a vault.
A re-scan obfuscated a file I had excluded
Re-scans reuse the options of the last full scan (--exclude, --angular-root, --user-secrets-id, …) when given none, as do pull and branch-switch. If you changed them deliberately, pass them again; --no-saved-options ignores the saved set. Restore the file with restore --file <path>.