# Git tip: how to search (grep) a repo and its submodules

**URL:** <https://community.tmpdir.org/t/git-tip-how-to-search-grep-a-repo-and-its-submodules/1198>\
**Category:** Tools\
**Tags:** tip, git\
**Created:** [November 27, 2023, 4:02pm UTC](https://community.tmpdir.org/t/git-tip-how-to-search-grep-a-repo-and-its-submodules/1198 "2023-11-27T16:02:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cbrake](https://community.tmpdir.org/user_avatar/community.tmpdir.org/cbrake/32/3_2.png) [@cbrake](https://community.tmpdir.org/u/cbrake)\
**Post date:** [November 27, 2023, 4:02pm UTC](https://community.tmpdir.org/t/git-tip-how-to-search-grep-a-repo-and-its-submodules/1198/1 "2023-11-27T16:02:55Z")

</div>

`git grep` is a useful tool to quickly search through source code to find something and ignore generated or transient build files. `git grep` can also search submodules with the `--recurse-submodules` option. Example:

`git grep --recurse-submodules "imx-boot"`

This is super handy when working with the Yoe distribution if you don’t know what meta-layer something is in.

This also illustrates why using git submodules for super-project management often makes a lot of sense. You can leverage a host of other tooling that is likely not available when you build a custom super-project management tool.

---

<div class="post-metadata">

**Author:** ![bminer](https://community.tmpdir.org/user_avatar/community.tmpdir.org/bminer/32/337_2.png) [@bminer](https://community.tmpdir.org/u/bminer)\
**Post date:** [November 28, 2023, 5:38pm UTC](https://community.tmpdir.org/t/git-tip-how-to-search-grep-a-repo-and-its-submodules/1198/2 "2023-11-28T17:38:18Z")

</div>

Neat! Never knew it even existed!
