Reputation: 52840
I am able to grep over all branches, as suggested here, but I want to open the results in a pager such as vim. Failing:
git grep -Ovim <regexp> $(git rev-list --all)
which works without the need to go over all commits with $(git rev-list --all)
.
How can I grep over all commits in all branches and open up the results in a pager such as vim?
Upvotes: 0
Views: 116
Reputation: 195059
If you want to use the open file in pager
function, you cannot across branches. It works only on the worktree.
But if you want to open the grep result in vim, it is easy:
git grep ... $(git rev-list --all)|vim -
You may want to tweak your grep option to suppress the color output.
Upvotes: 2