1

I execute this command:

git grep -Ee "alex" -- bin

and I don't return to shell. In the end there is "line (end)".

  1. How can I get rid of iine (end) without git grep -Ee "alex" -- bin | more or kill the process ? because I want to save color of match.

  2. Besides, I don't understand meaning of --exclude-standard and --no-exclude-standard. I get same result when I use or no use with these flags.

  3. How can I skip pattern between lines /* */ for example

  /*
    alex
    a
    */

git grep alex will skip

  • Like most commands, `git grep` pipes its output through a *pager*. The default pager is usually `less`. When `less` has reached the end of the text it should display, it shows you `(END)` to indicate that when you are done you should tell `less` to quit and return to your shell. Since this *may* (might or might not) involve removing the output window currently displaying the output, it would be unwise for `less` to exit immediately. (In other words it's compensating for another bit of not-so-good design.) – torek Oct 05 '17 at 15:12
  • Do you know answer to other questions ? @torek –  Oct 05 '17 at 16:49
  • Yes, but I don't have time to address them properly. The short versions are: (1) configure or disable your pager (2) these tell Git whether to search inside ignored files (3) that's generally viewed as too difficult to achieve with regular expressions on the command line. – torek Oct 05 '17 at 17:06
  • Give me please examples. 2) don't work @torek –  Oct 05 '17 at 20:38
  • Do you have files that are in fact ignored? E.g., if `foo.txt` (a) is *not* in the index and (b) *is* in the work-tree and (c) *is* listed in `.gitignore`, then `git grep expr` will not look for `expr` inside `foo.txt` under normal conditions, but with `--no-exclude-standard`, `git grep` will look inside `foo.txt` in this particular case. Note that *all* of a, b, and c must be true for the flag to have any meaning here. – torek Oct 05 '17 at 21:29
  • I did it but this flag doesn't work @torek –  Oct 06 '17 at 06:55
  • If you construct a [mcve] (and maybe post a new question) you're likely to get much higher quality answers. – torek Oct 06 '17 at 14:15

0 Answers0