github是一个非常丰富的资源,但是面对这丰富的资源很多人不知到怎么使用,更谈不上怎么贡献给他,我们需要使用github就要学习使用他的方法,学会了使用的方法,接受了他的这种观点我们才会慢慢的给他贡献自己的力量,这是我自己在学习的时候的一个笔记。现在分享给大家希望能够对一些人有帮助。
Search / Searching code

github搜索之代码搜索

Searching code

代码搜索

To search for code, use the following search qualifiers in any combination.

Tip: There's a list of search syntaxes you can add
to any search qualifier to further improve your results.

 

Considerations
for code search

Due to the complexity of searching code, there are a few restrictions on how searches are performed:

  • Only the default branch is considered. In most cases, this will be the master branch.
  • Only files smaller than 384 KB are searchable.
  • You must always include at least one search term when searching source code. For example, searching for language:go is
    not valid, while amazinglanguage:go is.
  • At most, search results can show two fragments from the same file, but there may be more results within the file.
  • You can't use the following wildcard characters as part of your search query:., : ; / \ ` ' " = * ! ? # $ & + ^ | ~ < >
    ( ) { } []
    . The search will simply ignore these symbols.

以上是代码搜索中需要注意的一些问题

默认搜索是从master分支搜索代码

只有小于384k的代码才是可以搜索到的

搜索的时候必须包含至少一个搜索关键词 如amazing
language:go

搜索语句不能有特殊字符如., : ; / \ ` ' " = * ! ? # $ & + ^ | ~ < > ( ) { } [].

Scope the search fields

指定搜索方式

octocat in:file
Matches code where "octocat" appears in the file contents.
搜索文件中有octocat的代码
octocat in:path
Matches code where "octocat" appears in the path name.
搜索路径中有octocat的代码
octocat in:file,path
Matches code where "octocat" appears in the file contents or the path name.
搜索路径中有octocat的代码或者文件中有octocat的代码
display language:scss
Matches code with the word "display," that's marked as being SCSS.
搜索用scss写的包含display的代码
Integer
Matches code with the word "Integer".
搜索包含Integer的字段

Search by language

通过语言搜索代码

You can search for code based on what language it's written in. For example:

element language:xml
size:100
Matches code with the word "element" that's marked as being XML and has exactly 100 bytes.
搜索大小为100字节的xml代码
user:mozilla
language:markdown
Matches code from all @mozilla's repositories that's marked as Markdown.
搜索mozilla用户下用markdown写的代码

Search
by the number of forks the parent repository has

通过fork的数量或者是否有父节点的方式搜索

If you would like forked results to appear, add the fork:true qualifier. For example:

android language:java
fork:true
Matches code in a forked repository with the word "android" that's written in Java.
搜索用java写的 android相关的代码并且被fork过

The size qualifier filters results based on the size of the file in which the code is found. For example:

function
size:>10000 language:python
Matches code with the word "function," written in Python, in files that are larger than 10 KB.
搜索与function相关的python代码,文件大小超过10kb

Search
by the location of a file within the repository

按照目录结构搜索

By including the path qualifier, you specify that resulting source code must appear at a specific location in a repository. Subfolders are considered during the search, so be as specific
as possible. For example:

console path:app/public language:javascript
Finds JavaScript files with the word "console" in an app/public directory (even if they reside inapp/public/js/form-validators).
app/public directory目录下搜索console关键字
form path:cgi-bin
language:perl
Finds Perl files under cgi-bin with the word "form" in them.
搜索cgi-bin目录下包含form的perl代码

Search by filename

通过文件名搜索

You can use the filename qualifier if there's a specific file you're looking for. For example:

filename:.vimrc commands
Finds *.vimrc* files with the word "commands" in them.
搜索 文件名匹配*.vimrc* 并且包含commands的代码
minitest
filename:test_helper path:test language:ruby
Finds Ruby files containing the word "minitest" named *test_helper* within the *test* directory.
在test目录中搜索包含minitest且文件名匹配"*test_helper*"的代码

Search by the
file extension

根据扩展名来搜索代码

The extension qualifier matches code files with a certain extension. For example:

form path:cgi-bin
extension:pm
Matches code with the word "form," under cgi-bin, with the .pm extension.
搜索cgi-bin目录下以pm为扩展名的代码
icon size:>200000
extension:css
Finds files larger than 200 KB that end in .css and have the word "icon" in them.
搜索超过200kb包含icon的css代码

Search
within a user's or organization's repositories

通过用户或者组织来查找

To grab a list of code from all repositories owned by a certain user or organization, you can use the usersyntax. For getting a list of code from a specific repository, you can use the repo syntax.
For example:

user:github extension:rb

github代码搜索技巧的更多相关文章

  1. github 项目搜索技巧-让你更高效精准地搜索项目

    目录 github 搜索技巧 案例 普通搜 搭配技巧搜 限定词 查找某个用户或组织的项目 辅助限定词 还没搞懂的(关于 forks.mirror.issues) 排序(放的是官网的链接) 使用指南 练 ...

  2. GitHub 基础搜索技巧

    一.GitHub基本信息栏 1.项目名称 2.项目简介 3.项目的README.md文档 ​ 项目的详细介绍 4.项目的最后更新时间 ​ 是否还有人维护等等... 二.搜索方式列举 1. 在name\ ...

  3. github常用搜索技巧

    1.在项目名称,readme文件和描述中包含关键字seckill的项目seckill in:name,readme,description 2.fork大于500,stars大于500springbo ...

  4. Github代码高级搜索小技巧

    Github搜索之代码搜索 可以使用下列搜索限定符的任意组合进行代码搜索 提示:通过将一连串的搜索语法添加到搜索限定符来进一步提高搜索结果的精度. ·代码搜索注意事项 由于搜索代码的复杂性,有一些搜索 ...

  5. Github搜索技巧-如何使用github找到自己感兴趣的项目

    Github现在不仅仅作为一个版本控制工具,更是一个开源的仓库,里面不但有优秀的开源代码,电子书,还有一些五花八门的项目,有些国家的法律也放在上面,作为程序员如何找到自己感兴趣的项目就非常重要了! 欢 ...

  6. 掌握 3 个搜索技巧,在 GitHub 上快速找到实用软件资源

    GitHub 作为目前广大程序猿最大的游乐场,在今年 6 月被 微软 以 75 亿美元价值的微软股票收购,GitHub 再次成为业界讨论的焦点.GitHub 以自由开放的定位吸引了相当多的个人开发者和 ...

  7. Github搜索技巧-如何使用github找到自己感兴趣的项目(转载)

    Github现在不仅仅作为一个版本控制工具,更是一个开源的仓库,里面不但有优秀的开源代码,电子书,还有一些五花八门的项目,有些国家的法律也放在上面,作为程序员如何找到自己感兴趣的项目就非常重要了! 欢 ...

  8. Github搜索技巧整理

    Github官方网址:https://github.com/ 一.详细官方文档:https://help.github.com/en/github/searching-for-information- ...

  9. github搜索技巧小结

    欢迎访问我的GitHub https://github.com/zq2599/blog_demos 内容:所有原创文章分类汇总及配套源码,涉及Java.Docker.Kubernetes.DevOPS ...

随机推荐

  1. windows下c语言获取程序当前的执行目录,读文件的代码片

    代码如下: #include "stdafx.h" #include "stdlib.h" #include <direct.h> #include ...

  2. javascript语言扩展:可迭代对象(5)

    文章1-4篇说的都是js中的可迭代对象,下面让我们看看ruby中的等价物. 不可否认,ruby中对于迭代器和生成器的语法都相当简洁:ruby从一开始就有一个简洁的基因,而js后来的不断扩充使得其有些语 ...

  3. MATLAB三点确定圆

    function [circleCenter,radius] = ThreePointCircle(obj,x,y,z) A=[x(1)-y(1),x(2)-y(2);z(1)-y(1),z(2)-y ...

  4. JS基础:基于原型的对象系统

    简介: 仅从设计模式的角度讲,如果我们想要创建一个对象,一种方法是先指定它的类型,然后通过这个类来创建对象,例如传统的面向对象编程语言 "C++"."Java" ...

  5. 排序算法入门之堆排序(Java实现)

    堆排序 在学习了二叉堆(优先队列)以后,我们来看看堆排序.堆排序总的运行时间为O(NlonN). 堆的概念 堆是以数组作为存储结构. 可以看出,它们满足以下规律: 设当前元素在数组中以R[i]表示,那 ...

  6. 二叉查找树之 Java的实现

    参考:http://www.cnblogs.com/skywang12345/p/3576452.html 二叉查找树简介 二叉查找树(Binary Search Tree),又被称为二叉搜索树.它是 ...

  7. 一篇迟到的gulp文章

    前言 这篇文章本应该在去年17年写的,但因为种种原因没有写,其实主要是因为懒(捂脸).gulp出来的时间已经很早了,16年的时候还很流行,到17年就被webpack 碾压下去了,不过由于本人接触gul ...

  8. SpringBoot整合ElasticSearch实现多版本的兼容

    前言 在上一篇学习SpringBoot中,整合了Mybatis.Druid和PageHelper并实现了多数据源的操作.本篇主要是介绍和使用目前最火的搜索引擎ElastiSearch,并和Spring ...

  9. 发布开源库到JCenter所遇到的一些问题记录

    这周末自己瞎折磨了下,如何发布开源库到 JCenter,然后这过程中碰到了一些问题,在此记录分享一下 本篇是基于上一篇:教你一步步发布一个开源库到 JCenter 介绍的流程.步骤中所遇到的问题,所以 ...

  10. 重装完的win10卡“请稍等”,然后电脑不断自动重启还是卡在“请稍等”?

    http://bbs.pcbeta.com/viewthread-1625778-1-1.html 说实话我用U盘安装win10遇到过几次这种情况,不管是win10正式版还是之前的个别win10测试版 ...