Search every Git revision for a text pattern
Build a paste-ready command, then review its compatibility and effects before running it.
git grep -n <pattern> $(git rev-list --all)Complete required fields to copy the generated command.
read-onlyno known side effects Compatibility
Linux + macOSVerified for Linux, macOS using bash, zsh syntax.
Operational knowledgereview due 2027-01-19
Requirementsgitgit must be installed and available on PATH.
Version supportgit Current supported releasesVerified for linux, macos using bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsa3e41c2:src/client.ts:18:const legacyEndpoint = '/v1';Representative successful output; values vary with the selected target and system state.
Known errorsgit: command not foundgit is missing or is not available on PATH.
Verifygit grep -n {{pattern}} $(git rev-list --all)The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01gitCommandRuns the git stage of this one-liner.
02grepArgumentPasses grep to git.
03-nOptionApplies the command-specific numeric, dry-run, or non-resolving mode.
04<pattern>ParameterA value supplied in the Fill parameters section.
05$(gitVariableExpands a value from the current shell environment or loop.
06rev-listArgumentPasses rev-list to git.
07--all)OptionConfigures git with the --all) option.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
git grep -n 'legacyEndpoint' $(git rev-list --all)
Example output
a3e41c2:src/client.ts:18:const legacyEndpoint = '/v1';
7bc219d:src/client.ts:21:const legacyEndpoint = '/v1';
Illustrative output — exact values vary by system and data.
Official sources