Created
March 26, 2018 11:29
-
-
Save mity/528fd972d36dd5d4c24a68be62c4c1f9 to your computer and use it in GitHub Desktop.
Grepping over all git repos found anywhere in the subtree of current working directory.
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
#!/bin/bash | |
# | |
# Grepping over all git repos found anywhere in the subtree of current working | |
# directory. | |
# | |
find . -type d -name .git | while read line; do | |
repo=`dirname "$line"` | |
( cd "$repo" && git grep -n "$@" | sed "s|^|$repo/|" ) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment