如何在github上的存储库中的子文件夹中搜索特定的单词或条目 [英] how to search a particular word or entry inside a sub folder in a repository on github
问题描述
我只是寻找一个例子(在github的高级搜索中正确的命令)搜索某个特定存储库中的文件夹内的单词。我想这将涉及到路径:选项,但不知道如何使用它。 作为一个例子,我需要搜索一个函数名称clean 或在以下位置的jquery测试套件中的干净或类似功能的测试用例 - 我知道有一些过滤器像回购:和路径:由github提供,但不知道如何使用它们。 另外,我不满意于类似问题的答案 - 我明白我可以将它分叉到我的本地机器并在那里进行搜索,但我不想简单地下载整个存储库来搜索它。我只需要在github网站上在线搜索它。 预先致谢!! 我得到41个结果,其中这个查询。 关键是指定用户/ reponame,而不是reponame : 与路径参数的通配符结合使用时,我只用参数搜索?这个查询& language = R> rel =nofollow> q = repo%3ahadley / ggplot2%20facet_wrap%20path%3ainst /%2a.r& repo =&langOverride =& start_value = / a>: 因此,对于路径,关键是添加通配符(似乎不是文档) 来自评论: 我需要找到 在这种情况下:
https://github.com/jquery/jquery/tree/master/test
在github存储库中搜索定义给定函数的文件
回购:hadley / ggplot2
回购:hadley / ggplot2 facet_wrap路径:inst / *。r
path:inst /
单独不起作用。 路径:*
或路径:*。r
will。
< hr>
beforeSend
这个文件中的条目 - jquery / test / unit / ajax.js
at github.com /jquery/jquery/blob/master/test/unit/ajax.js
但是当我触发 repo:jeresig / jquery beforeSend路径:jquery / test / unit * .js
在预先搜索我没有得到任何结果。
我也困惑应该使用哪个用户作为jquery有许多贡献者,如John Resig,timmywil
jquery / jquery
(不需要用户名)
路径:
不得重复回购名称:所以,路径:test / unit * .js
,而不是 path:jquery / test / unit * .js
回购:jquery / jquery beforeSend p ath:test / unit * .js
会起作用,并且。
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:
repo:hadley/ggplot2
Combined with wildcard for the path argument, I select only one argument with this query:
repo:hadley/ggplot2 facet_wrap path:inst/*.r
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:*
or path:*.r
will.
From the comments:
I need to find "
beforeSend
" entry which is in this file - "jquery / test / unit / ajax.js
" atgithub.com/jquery/jquery/blob/master/test/unit/ajax.js
but when I firerepo:jeresig/jquery beforeSend path:jquery/test/unit*.js
in the advance search I don't get any results.
I am also confused which user should I use as jquery has many contributors like John Resig, timmywil
In this case:
- the repo is
jquery/jquery
(no need for a username here) - the
path:
directive to use must not repeat the repo name: so,path:test/unit*.js
, notpath:jquery/test/unit*.js
repo:jquery/jquery beforeSend path:test/unit*.js
will work, and provide 4 results within JQuery Code.
这篇关于如何在github上的存储库中的子文件夹中搜索特定的单词或条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!