Skip to content

Commit b6558fd

Browse files
[docs] Describe using git grep in FAQ.
Also changed the grep example to use long flag names for clarity.
1 parent 296d252 commit b6558fd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/HowToGuides/FAQ.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,14 @@ This very depends on what X is, but some broad guidelines are:
6464
1. Do a case-insensitive recursive string search.
6565
- Use a specialized tool like [ripgrep](https://github.com/BurntSushi/ripgrep)
6666
or [ag](https://github.com/ggreer/the_silver_searcher).
67+
- Use `git grep --ignore-case "mypattern"`. `git grep` also supports helpful
68+
flags which provide more context:
69+
- `--show-function`: Tries to print the function name that a match was
70+
found in.
71+
- `--function-context`: Tries to print the entire surrounding function
72+
containing the match.
6773
- Use 'Find in Workspace' in Xcode (<kbd>⌘</kbd>+<kbd>⇧</kbd>+<kbd>F</kbd>).
68-
- Use `grep -i -r "mypattern" .`.
74+
- Use `grep --ignore-case --recursive "mypattern" .`.
6975
2. Go through the [Documentation Index](/docs/README.md).
7076

7177
### How do I build the documentation as HTML?

0 commit comments

Comments
 (0)