The following will kill the shell on macOS: ``` git for-each-ref --format='%(refname:short)' refs/heads | xargs -I {} sh -c 'echo "Branch: {}"; git grep "search_term" {}' ``` It's not a minimal example, likely it can be made shorter.