Skip to content

Instantly share code, notes, and snippets.

@matthewkturner
Created March 30, 2019 03:26
Show Gist options
  • Save matthewkturner/ca49cbcbf36b7189f3b0d5248d723838 to your computer and use it in GitHub Desktop.
Save matthewkturner/ca49cbcbf36b7189f3b0d5248d723838 to your computer and use it in GitHub Desktop.
git grep
function gg() {
local grep="$1"
until [ -z "$3" ]
do
shift
grep+=" $1"
done
local path=$2
if [ -z "$2" ]
then
path=`git rev-parse --show-toplevel`
fi
git grep -n --color "$grep" "$path"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment