Read more

Git: Search for text in all branches

Henning Koch
September 17, 2020Software engineer at makandra GmbH

To find a version containing the regular expression foo in the history of any branch:

git grep foo $(git rev-list --all)
Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

You may also limit the search to a file extension, e.g. Ruby files (.rb) like this:

git grep foo $(git rev-list --all) -- *.rb
Posted by Henning Koch to makandra dev (2020-09-17 09:14)