The alias was from René Scharfe's Google+ post [1]. For reference when
the Internet (or Google) is down:

    While grep is an indispensable tool if you're working with text
    files, some aspects of it could be improved. ack (or ack-grep, as
    it's called on Debian) has a few nice ideas in this regard. I
    especially like its presentation of search results from multiple
    files, which leaves more space for the actual file contents.

    And with the upcoming release 1.7.7 of git, its built-in grep
    command can dress up like ack and show search results in that
    nicer way, too. Run this (single line) command to add an alias
    that you can call as "git ack" ...


Signed-off-by: Nguyễn Thái Ngọc Duy <>
 One of the few things I like about Clearcase is the examples section
 in their man pages, which contain very practical and often used
 commands. So I'd like to do the same way to git: start adding
 examples that are useful, not just ones that demonstrate difficult
 concepts or use cases.
 Those often used commands are likely popular aliases on the Internet.
 The next one that comes to mind after "git ack" is "git lol". We
 probably won't add them all. Certain concensus is needed to keep
 examples from becoming a encyclopedia.

 Good or bad move?

 Documentation/git-grep.txt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
index 8497aa4..a4881e5 100644
--- a/Documentation/git-grep.txt
+++ b/Documentation/git-grep.txt
@@ -269,6 +269,12 @@ Examples
        Looks for a line that has `NODE` or `Unexpected` in
        files that have lines that match both.
+`git -c color.grep.filename='bold green' -c color.grep.match='black yellow' 
grep --break --heading -n pattern`::
+       Searches for `pattern` and produces output similar to ack(1).
+       Alternatively you could add an alias for frequent use:
+`git config --global --add alias.ack "-c color.grep.filename='bold green' -c 
color.grep.match='black yellow' grep --break --heading -n"`
 Part of the linkgit:git[1] suite

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to