cli.sgit.ai / Command reference / sgit grep

sgit grep

Search the files of the working copy or a revision, as git grep.

Generated from sgit help all --format json, sgit-ai v0.26.8. No subcommands. To change this page, change the command's register() in the CLI and regenerate.

sgit grep [options] [positionals]
ArgumentWhat it is
positionalsoptionalThe pattern (unless -e), then revisions to search instead of the working copy; paths go after --
OptionWhat it does
--jsonOne JSON object (grep_v1)
--offlineNever fetch a blob this clone does not hold
--text, -aSearch binary files as text
--untrackedAlso search untracked files
-AN lines after each match
-BN lines before each match
-CN lines around each match
-E, --extended-regexpAccepted: patterns are Python regexes
-F, --fixed-stringsThe pattern is a literal string
-HPrint file names (the default)
-IDo not search binary files
-L, --files-without-matchPrint only the files that do not
-P, --perl-regexpAccepted: patterns are Python regexes
-c, --countPrint path:count
-d, --directoryVault directory (default: .)
-eA pattern (repeatable: lines matching any)
-hDo not print file names
-i, --ignore-caseIgnore case
-l, --files-with-matchesPrint only the files that match
-m, --max-countStop after N matching lines per file
-n, --line-numberPrefix line numbers
-o, --only-matchingPrint only the matched parts
-q, --quietPrint nothing; the exit code tells
-v, --invert-matchLines that do not match
-w, --word-regexpMatch whole words

This page as markdown · its source, admin/content/reference/sgit-cli-reference.json