mirror of
https://github.com/tiimgreen/github-cheat-sheet.git
synced 2025-10-06 03:11:33 +02:00
Update Git Grep section
This commit is contained in:
19
README.md
19
README.md
@@ -789,26 +789,27 @@ $ git show :/typo
|
|||||||
|
|
||||||
|
|
||||||
### Git Grep
|
### Git Grep
|
||||||
Grep pattern under your git versioned folder.
|
|
||||||
|
Git Grep will return a list of lines matching a pattern.
|
||||||
|
|
||||||
Running:
|
Running:
|
||||||
```
|
```bash
|
||||||
git grep aliases
|
$ git grep aliases
|
||||||
```
|
```
|
||||||
will show all the files containing the string *aliases*.
|
will show all the files containing the string *aliases*.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
*Press `q` to quit.*
|
*Press `q` to quit.*
|
||||||
|
|
||||||
We can also use multiple flags for more advanced search. For example:
|
You can also use multiple flags for more advanced search. For example:
|
||||||
|
|
||||||
* `-e` The next parameter is the pattern (including regex)
|
* `-e` The next parameter is the pattern (e.g. regex)
|
||||||
* `--and` Combine multiple patterns.
|
* `--and`, `--or` and `--not` Combine multiple patterns.
|
||||||
|
|
||||||
Use it like this:
|
Use it like this:
|
||||||
```
|
```bash
|
||||||
git grep -e pattern --and -e anotherpattern
|
$ git grep -e pattern --and -e anotherpattern
|
||||||
```
|
```
|
||||||
|
|
||||||
[*Read more about the Git `grep` command.*](http://git-scm.com/docs/git-grep)
|
[*Read more about the Git `grep` command.*](http://git-scm.com/docs/git-grep)
|
||||||
|
Reference in New Issue
Block a user