
Using Git Grep - jaytaylor
https://blog.afoolishmanifesto.com/posts/you-should-be-using-git-grep/
======
euank
I personally use the silver searcher[0], also known as ag, which is .gitignore
aware and I find quite quick and useful.

In fact, ag references git-grep in its readme while this blogpost makes no
mention of ag. I suspect the author just doesn't know about ag or doesn't want
to install an additional less-standard package... I personally find it worth
the installation.

[0]:
[https://github.com/ggreer/the_silver_searcher](https://github.com/ggreer/the_silver_searcher)

~~~
justinmk
> I suspect the author just doesn't know about ag

Actually, the author uses Windows, and ag is a pain to build on Windows. pt[1]
(written in go) has drop-in builds for Windows, Mac, and Linux.

[1]
[https://github.com/monochromegane/the_platinum_searcher](https://github.com/monochromegane/the_platinum_searcher)

~~~
ggreer
The main reason for poor windows support is that I didn't own a copy of
windows until two months ago. There is a windows fork of ag, but it doesn't
compile on *nix:
[https://github.com/kjk/the_silver_searcher](https://github.com/kjk/the_silver_searcher)

That said, pt is pretty cool. If that's what works for you, keep using it.

~~~
pmelendez
Thanks for that... I am a big fan of ag at work but I had trouble making it
work on cygwin at home. This should solve that problem :)

------
unwind
It took me a while to understand that the article's use of "frew" simply was a
random placeholder search string. I started looking up those characters in the
docs, and becoming annoyed since it made no sense. :)

Also, shameless plug: my Gitbrowser plug-in for the Geany editor/IDE support
git grep, and makes the search results clickable in the editor
([https://github.com/unwind/gitbrowser](https://github.com/unwind/gitbrowser)).

------
james-skemp
2nd gen Nexus 7 doesn't like the SSL cert and removing HTTPS redirects back to
that version.

In case the author is reading these comments, that's unfortunate. (Chrome for
Android, should be current.)

~~~
omh
It looks like the server is slightly misconfigured, it isn't serving the
required intermediate certificate[1].

Desktop browsers are smart enough to find the intermediate certificate and
then verify the chain, but technically I don't think this is part of the spec.

[1]
[https://www.ssllabs.com/ssltest/analyze.html?d=blog.afoolish...](https://www.ssllabs.com/ssltest/analyze.html?d=blog.afoolishmanifesto.com&hideResults=on)

~~~
frioux
I'll see if I can fix this when I get a chance. If anyone knows how to fix it
for apache 2.2 I'd appreciate it; I can nopaste my config.

------
badman_ting
I found out about it maybe six weeks ago and have been using it ever since,
pretty much every day. Extremely useful.

------
barrkel
I invoke git grep with helm-git-grep inside Emacs. Almost instantaneous
incremental search across the whole repo.

------
adamors
Git grep also integrates nicely into Vim with Fugitive. It shows the results
exactly like :vimgrep.

------
hyp0
git grep can be used outside a git repo (git 1.7.8):

    
    
      --no-index

~~~
notfoss
I was confused after reading your comment, as I initially ran "git grep" in my
$HOME and it worked fine. Then I remembered that my $HOME is managed using
git!

Indeed, it doesn't work in a non git directory without the switch. Thanks for
pointing it out.

