Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.

[1] https://stackoverflow.com/a/15293283



You can combine git grep with fzf to fuzzy search commit message and also see preview of the selected commit. See https://gist.github.com/junegunn/8b572b8d4b5eddd8b85e5f4d40f...


git grep is amazing. I almost never need an alternative.


same here :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: