如何在github上的存储库中的子文件夹中搜索特定的单词或条目 [英] how to search a particular word or entry inside a sub folder in a repository on github

查看:155
本文介绍了如何在github上的存储库中的子文件夹中搜索特定的单词或条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是寻找一个例子(在github的高级搜索中正确的命令)搜索某个特定存储库中的文件夹内的单词。我想这将涉及到路径:选项,但不知道如何使用它。


作为一个例子,我需要搜索一个函数名称clean 或在以下位置的jquery测试套件中的干净或类似功能的测试用例 -

https://github.com/jquery/jquery/tree/master/test



我知道有一些过滤器像回购:和路径:由github提供,但不知道如何使用它们。

另外,我不满意于类似问题的答案 -
在github存储库中搜索定义给定函数的文件



我明白我可以将它分叉到我的本地机器并在那里进行搜索,但我不想简单地下载整个存储库来搜索它。我只需要在github网站上在线搜索它。



预先致谢!!

解决方案

我得到41个结果,其中这个查询



关键是指定用户/ reponame,而不是reponame :

 回购:hadley / ggplot2 

与路径参数的通配符结合使用时,我只用参数搜索?这个查询& language = R> rel =nofollow> q = repo%3ahadley / ggplot2%20facet_wrap%20path%3ainst /%2a.r& repo =&langOverride =& start_value = / a>:

 回购: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" at github.com/jquery/jquery/blob/master/test/unit/ajax.js but when I fire repo: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, not path:jquery/test/unit*.js

     repo:jquery/jquery beforeSend path:test/unit*.js

will work, and provide 4 results within JQuery Code.

这篇关于如何在github上的存储库中的子文件夹中搜索特定的单词或条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆