Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | git-grep(1) |
| 2 | =========== |
| 3 | |
| 4 | NAME |
| 5 | ---- |
| 6 | git-grep - print lines matching a pattern |
| 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Junio C Hamano | a6331a8 | 2006-01-22 07:50:33 | [diff] [blame] | 11 | 'git-grep' [<option>...] [-e] <pattern> [--] [<path>...] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 12 | |
| 13 | DESCRIPTION |
| 14 | ----------- |
| 15 | Searches list of files `git-ls-files` produces for lines |
| 16 | containing a match to the given pattern. |
| 17 | |
| 18 | |
| 19 | OPTIONS |
| 20 | ------- |
Junio C Hamano | a6331a8 | 2006-01-22 07:50:33 | [diff] [blame] | 21 | `--`:: |
| 22 | Signals the end of options; the rest of the parameters |
| 23 | are <path> limiters. |
| 24 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 25 | <option>...:: |
| 26 | Either an option to pass to `grep` or `git-ls-files`. |
Junio C Hamano | a6331a8 | 2006-01-22 07:50:33 | [diff] [blame] | 27 | |
| 28 | The following are the specific `git-ls-files` options |
| 29 | that may be given: `-o`, `--cached`, `--deleted`, `--others`, |
| 30 | `--killed`, `--ignored`, `--modified`, `--exclude=*`, |
| 31 | `--exclude-from=*`, and `--exclude-per-directory=*`. |
| 32 | |
| 33 | All other options will be passed to `grep`. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 34 | |
| 35 | <pattern>:: |
Junio C Hamano | a6331a8 | 2006-01-22 07:50:33 | [diff] [blame] | 36 | The pattern to look for. The first non option is taken |
| 37 | as the pattern; if your pattern begins with a dash, use |
| 38 | `-e <pattern>`. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 39 | |
| 40 | <path>...:: |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 41 | Optional paths to limit the set of files to be searched; |
| 42 | passed to `git-ls-files`. |
| 43 | |
| 44 | |
| 45 | Author |
| 46 | ------ |
| 47 | Written by Linus Torvalds <torvalds@osdl.org> |
| 48 | |
| 49 | Documentation |
| 50 | -------------- |
| 51 | Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>. |
| 52 | |
| 53 | GIT |
| 54 | --- |
| 55 | Part of the gitlink:git[7] suite |
| 56 | |