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/.gitattributeswith the following contentto mark all migrations as binary files and then use
git grep -Ito skip binary files.If you also want to ignore migrations in diffs you can do so by changing the content of
.gitattributestoThere is discussion about adding attributes respected by
grep, so there might be a proper solution one day.