Created
March 30, 2019 03:26
-
-
Save matthewkturner/ca49cbcbf36b7189f3b0d5248d723838 to your computer and use it in GitHub Desktop.
git grep
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
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