Last active
December 30, 2016 20:25
-
-
Save nchase/5a1f483da8cbad133d346bf85c0ec49f to your computer and use it in GitHub Desktop.
git-grep configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# git-grep configuration – `man git-grep | cat && open https://git-scm.com/docs/git-grep` | |
## turn off pager; print results directly to stdout instead: | |
git config --global pager.grep false | |
## enable line numbers by default: | |
git config --global grep.lineNumber true | |
## you can't set --ignore-case in git config. | |
## so instead, add the `-i` flag (short for`--ignore-case`) | |
## when searching: | |
git grep -i {query} | |
## use the --break flag to add a linebreak between files containing matches: | |
git grep -i --break {query} | |
## optionally, add your own convenient and nearly-familiar alias for git grep: | |
alias gg='git grep --ignore-case --break' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment