Making git grep ignore binary the default
- From
El_Hoy <eloyesp@gmail.com>
- Date
- Oct 17, 2025, 15:00 UTC
- Message-ID
- <CAPapNH0C3+bU-RUO6oFHUKLjKuNdm-aXgsFTHFobYVrJXWzr=g@mail.gmail.com>
I've found that there is a flag (`git grep -I`) to ignore binary files, it works great, but I've found no way to make it the default.
It would be great to have a config for this. This way a possible implementation implies:
- Adding a config `grep.ignoreBinary` that defaults to false, keeping the current default.
- Adding a flag `git grep --include-binary` to revert the default. But maybe the `-a, --text` flag already does that.
Also, maybe the next git version (3.0) can default to ignore-binary as a better default.
Finally, if this makes sense, I can do my best to implement the change in the code.
Regards. - Eloy