With south in Django we have something like:
/app
/migrations
.. migration files.
Since migration files represent historical structure rather than what's currently in there I would prefer to not search through them each time. Is there some way I can exclude them by default when running git grep?
This is a bad hack, but it might work for you: create app/migrations/.gitattributes with the following content
* binary
to mark all migrations as binary files and then use git grep -I to skip binary files.
If you also want to ignore migrations in diffs you can do so by changing the content of .gitattributes to
* binary -diff
There is discussion about adding attributes respected by grep, so there might be a proper solution one day.
I have an alias git gr for git grep that enables colors and case insensitivity. You could do this and add excludes. And it's faster to type!
Otherwise, there's no way to change the default behavior of Git commands for the most part, because they are used directly internally.
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