Skip to content

Instantly share code, notes, and snippets.

@nchase
Last active December 30, 2016 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nchase/5a1f483da8cbad133d346bf85c0ec49f to your computer and use it in GitHub Desktop.
Save nchase/5a1f483da8cbad133d346bf85c0ec49f to your computer and use it in GitHub Desktop.
git-grep configuration
# 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