I keep a directory with up-to-date clones of all relevant repos. This is separate from my usual working directory. I experimented with git workspaces, but it wasn't worth the trouble, especially since the set of repos I'm working on is not necessarily the same as the ones I keep in my search dir.
At the root level I maintain two scripts:
clone.sh
update.sh
clone.sh has one
git clone --recursive ..
line per repo.
When I run low on disk space I sometimes delete larger repos.
The clone script allows me to easily re-clone everything in this case.
update.sh is similar but pulls all repos.
For global search across all branches I do:
git grep <regexp> $(git rev-list --all)
(when I forget the line I look it up in Stack Overflow [1])
This is especially useful since I work a lot with Bitbucket and to the best of my knowledge you can only search the default branches there.
When I know the branch, but want to search across all history I use git pickaxe, aka
git -S ...
All of this is not very sophisticated and takes a lot of disk space but it works pretty well for me.
At the root level I maintain two scripts:
clone.sh has one line per repo. When I run low on disk space I sometimes delete larger repos. The clone script allows me to easily re-clone everything in this case.update.sh is similar but pulls all repos.
For global search across all branches I do:
(when I forget the line I look it up in Stack Overflow [1])This is especially useful since I work a lot with Bitbucket and to the best of my knowledge you can only search the default branches there.
When I know the branch, but want to search across all history I use git pickaxe, aka
git -S ...
All of this is not very sophisticated and takes a lot of disk space but it works pretty well for me.
[1] https://stackoverflow.com/a/15293283