I am just looking for an example ( the correct command to fire in the advance search at github ) about searching a word inside a folder of a particular repository. I guess this will involve the “path:” option but not sure how to use it
As an example I need to search for a function name “clean” or a test case for “clean” or similar function inside the jquery test suite at the following location –
https://github.com/jquery/jquery/tree/master/test
I understand there are some filters like repo: and path: provided by github but not sure how to use them.
Also I am not satisfied with an answer posted for a similar question at –
Search a github repository for the file defining a given function
I understand I can fork it to my local machine and do a search there but I don’t want to download the whole repository simply to search it. I just need to search it online at the github site itself.
Thanks in advance !!
I get 41 result with this query.
The key is to specify the user/reponame, not the the reponame:
Combined with wildcard for the path argument, I select only one argument with this query:
So, for path, the key is to add a wildcard (which doesn’t seem to be documented anywhere).
path:inst/alone won’t work.path:*orpath:*.rwill.From the comments:
In this case (2012):
jquery/jquery(no need for a username here)path:directive to use must not repeat the repo name: so,path:test/unit*.js, notpath:jquery/test/unit*.jsrepo:jquery/jquery beforeSend path:test/unit*.jswill work, and provide 4 results within JQuery Code.
Update 2022:
The query would be:
repo:jquery/jquery beforeSend path:test extension:*js type=Code&ref=advsearch