git-fast-content-search
Search Git projects and normal files for literal text quickly.
Latest: v0.1.4
- Removed
skill-card.md.
git-fast-content-search
When to use
Use this skill when given a file or directory and a literal string to find. It supports Windows and macOS through Python 3.
Steps
-
Run the script with Python 3:
sh python scripts/fast_content_search.py "<directory-or-file>" "<text>" -
Return each JSON line as one match.
pathis absolute. -
Read
is_git_project_fileto identify a file found in Git. -
Read
search_methodto identifygit-greporfilesystem-untracked.
The script walks non-Git directories recursively. When it finds a Git worktree,
it runs git grep -I -l -z -F for tracked files. It then finds every untracked
file with git status --porcelain=v1 -z --untracked-files=all and searches those
files normally. Git metadata, symlinks, and likely binary files are skipped.
A UTF-16 BOM is supported.
Gotchas
- The search is literal. It does not interpret regular expressions.
- Git results include files Git searches in that worktree, normally tracked files.
- Files with NUL bytes are skipped unless they start with a UTF-16 BOM.
- Permission errors and unreadable files are skipped.
- Use
--format linesfor tab-separated human-readable output.
