git grep
The more I use it, the more I realize git is not just a version control system, it is more of a toolbox. The latest tool I learned about was git grep
.
Basically, this is grep
, scoped to your repo, with nice standards. With my rails apps, I used to do grep pattern app -r
, now I do git grep pattern
. It is way faster than the system grep (at least on OS X), and it gives me colors without me explicitly asking.
While this is not a very good use case, since the same result can be achieved through standard grep
and reading its manual, git grep
has some specific options than the standard counterpart doesn't have, such as the scope of the search (current index, take untracked or ignored files into account), and those are the one that will make the difference the day you need them.