Search code inside a Github project

前端 未结 7 1808
被撕碎了的回忆
被撕碎了的回忆 2020-11-29 14:54

Is there a way to grep for something inside a Github project\'s code?

I could pull the source and grep it locally, but I was wondering if it\'s possible through the

7条回答
  •  醉话见心
    2020-11-29 15:57

    Go here: https://github.com/search and enter "pattern repo:user_name/repo_name".

    For example, to search for cnn_learner in the fastai repo of user fastai, enter this:

    cnn_learner repo:fastai/fastai

    That's it. The only annoyance is you'll need an extra click. It will tell you:

    We couldn’t find any repositories matching 'cnn_learner repo:fastai/fastai'

    because by default it searches for repositories matching that search string...

    So just click on the left on "Code" and it will display what you want.

    Or get the code search results directly with a URL like this:

    https://github.com/search?q=cnn_learner+repo%3Afastai%2Ffastai&type=code

提交回复
热议问题