Primoz Cigler on WordPress, Business, and Code

PROTIP: Use `git grep`

git grep is amazing! You should start using it right now.

Here are several reasons why:

  • It is blazing fast. I doubt any code editor or IDE comes close to search in a terminal.
  • If you keep your repo lean and tidy, it will only search for your source files. Everything that’s not a source should not reside in the repository anyway (i.e. compiled css/js files, vendor/ by composer, bower_components/ by bower, node_modules/ by npm …)
  • You will be able to use different regex flavors for search.
  • You can easily filter down to specific file types.
  • You have docs at hand by typing git help grep.

Continue with reading