How do I make git grep ignore large text files? Though I have some thousands of them, I never need to grep over them. (Think of foreign-language dictionary.) Hence, every time I do git grep I have to specify a path explicitly or cd there, because else it would take ages:
$ time git grep something somewhere/
somewhere/file.txt: something
real 0m0.049s
user 0m0.044s
sys 0m0.040s
If I could make git grep ignore said files, I would do it with less typing:
$ time git grep something
somewhere/file.txt: something
real 1m22.159s
user 0m0.472s
sys 0m1.448s
This used to be the case, but now the times are appalling. Also, I can't remove these files from git, because I need to track changes in them. Hence, adding them to .gitignore doesn't help.
I would be inclined to re-organize my project so that the large text files that are 'data' are in a different folder from where I typically grep. Does not take much effort to do and keeps the non-source code components out of the way of the day to day operations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With