find_in_branches

greps each of your branches for a specified string

find_in_branches solves the problem of knowing you’ve seen something in your codebase, but not knowing which branch you saw it in.

When searching it will grep for your string and find all of the local branches that it exists in.

NOTE: “Local branches” being defined as the stuff that git branch outputs, not the full list that you get with git branch -a

Prerequisites: Ruby

Usage

Usage: find_in_branches "something to grep for" some/file/to/grep/in [branch_name_regexp]

It will then iterate over all your local branches and look for that phrase.

OR
if you say "-L something to grep for" it will tell the branches in which that
string was NOT found by grep (on the specified file.

This will NOT bother to grep the file in branches where it does not exist.

Metadata:

Tags:

  • cli
  • git
  • search