World map

 

BM: Baca dalam Bahasa Melayu

World 9: Power Tools

Code search

You will learn: how to find code across GitHub with search filters.

The problem

Your team has 30 repos. Where is fetchWeather used? Do you clone them all and look?

Pick one answer.

Try it

Filters are called qualifier: A filter in a search, like repo: or language:.. Which one fits each search?

Drag a card into a box. Or tap the card, then tap the box.

        Predict

        You search symbol:fetchWeather. What comes back?

        Pick one answer.

        Try it

        You searched TODO path:src/. Tap every result that matches.

        Tap every result that matches.

        0 of 2 found

        Check

        You want the exact phrase “sparse index”, with the space. What do you type?

        Pick one answer.

        You did it!

        You can now find code across GitHub in seconds.

        Go deeper (optional)

        Only the default branch is searched. Put a regex between slashes: /fetch.*Weather/. Use NOT to skip things: log4j NOT is:fork. In the terminal, gh search code works too. But it uses GitHub’s older search engine, so results can differ.