![511d145b807f973ccce31ae8e5c080b2.png](https://i-blog.csdnimg.cn/blog_migrate/c34af70c777b38fcc987d02783a4095b.jpeg)
引言
GitHub 作为目前广大程序员最大的游乐场,怎么在Github上搜索优秀的项目就显得尤为重要.下面是在Github上快速找到自己需要的开源项目的几个搜索技巧
![bdc7e5474567c21fe597229fa9774c89.png](https://i-blog.csdnimg.cn/blog_migrate/3f28b090f8df373de0952f6216ccab8b.png)
1.明确搜索仓库标题、仓库描述、README
直接限定关键字只查特定的地方。比如咱们只想查找仓库名称包含 Spring Cloud 的仓库,可以使用语法
in:name 关键词
![cf273208eb4b60c50ffea947e88a75ac.png](https://i-blog.csdnimg.cn/blog_migrate/730a73c4ce6b382015860fac20ea8610.jpeg)
如果想查找描述的内容,可以使用这样的方式:
in:descripton 关键词
![524e49106b843213ca96f077028ff18a.png](https://i-blog.csdnimg.cn/blog_migrate/0eab946dbc96f8e3f2066005e125f650.png)
一般项目,都会有个 README 文件,如果要查该文件包含特定关键词的话,我想你猜到了:
in:readme 关键词
2.明确搜索 star、fork 数大于多少的
一个项目 star 数的多少,一般代表该项目的受欢迎程度。虽然现在也有垃圾项目刷 star ,但毕竟是少数, star 依然是个不错的衡量标准。
stars: > 数字 关键字。
比如咱们要找 star 数大于 3000 的Spring Cloud 仓库,就可以这样:
stars:>3000 spring cloud
![ebe8cf7ea6ae81f9281c5d0533eeba7b.png](https://i-blog.csdnimg.cn/blog_migrate/dbe8076aa4aad663f6b36fef9ae95cdb.png)
如果不加 >= 的话,是要精确找 star 数等于具体数字的,这个一般有点困难。
如果要找在指定数字区间的话,使用:
stars: 10..20 关键词
fork 数同理,将上面的 stars 换成 fork,其它语法相同:
forks:10..20 spring cloud
3.明确搜索仓库大小的
比如你只想看个简单的 Demo,不想找特别复杂的且占用磁盘空间较多的,可以在搜索的时候直接限定仓库的 size 。
使用方式:size:>=5000 关键词
这里注意下,这个数字代表 K, 5000 代表着5M
4.明确仓库是否还在更新维护
我们在确认是否要使用一些开源产品、框架的时候,是否继续维护是很重要的一点。如果已经过时没人维护的东西,踩了坑就不好办了。而在 GitHub 上找项目的时候,不再需要每个都点到项目里看看最近 push 的时间,直接在搜索框即可完成。
元旦刚过,比如咱们要找临近年底依然在勤快更新的项目,就可以直接指定更新时间在哪个时间前或后的。
通过这样一条搜索 pushed:>2020-01-03 spring cloud
咱们就找到了 1 月 3 号之后,还在更新的项目。
![d81937c786348d48e9f7c969c59cea9b.png](https://i-blog.csdnimg.cn/blog_migrate/310a4cc98beb101fe6c44928fb0a9d55.png)
5.明确搜索仓库的语言
比如咱们就找 Java 的库, 除了像上面在左侧点击选择之外,还可以在搜索中过滤。像这样:
language:java 关键词
6.明确搜索某个人或组织的仓库
比如咱们想在 GitHub 上找一下某个大神是不是提交了新的功能,就可以指定其名称后搜索,例如咱们看下 Josh Long 有没有提交新的 Spring Cloud 的代码,可以这样使用:
user:joshlong
组合使用一下,把 Java 项目过滤出来,多个查询之间「空格」分隔即可。
user:joshlong language:java
![4f29700481031b3b1afaa840633db331.png](https://i-blog.csdnimg.cn/blog_migrate/40675f8e4257fe7b4e3a7c3e822368f4.png)
7、搜索小技巧细节
(7.1)in:name person count
项目题目中有person count的开源项目
![d4ff0818cb62b7beb170eadb32c45430.png](https://i-blog.csdnimg.cn/blog_migrate/4b60b7e1e9f8d2c582505920738c8097.png)
**(7.2)in:description person count
项目描述中有person count的开源项目
![6864bc6b81423bae71dd6fbf443db0dd.png](https://i-blog.csdnimg.cn/blog_migrate/ed3fcd4753d20212c0dce12a50c54bba.png)
(7.3)in:readme person count
项目详情(readme)中有person count的开源项目
![3f02612849167b45d481e34768c5a1a0.png](https://i-blog.csdnimg.cn/blog_migrate/fc6e6205eb87828400bfa46cb34e95bb.png)
(7.4)stars:>3000
stars数大于3000的开源项目
![0d2cc149f4046439bb57912657a26e9b.png](https://i-blog.csdnimg.cn/blog_migrate/c3433fbefc0ad60a30416a67b7d88742.png)
(7.5)forks:>3000
forks数大于3000的开源项目
![f4a0f136d68b845c4866f1e2f3c11488.png](https://i-blog.csdnimg.cn/blog_migrate/c1339039615c97596e6c743b58b74cc4.png)
(7.6)pushed:>2019-11-17
最近更新时间在2019年11月17日之后的开源项目
![eead082eb3416f620a69ce30ec06f053.png](https://i-blog.csdnimg.cn/blog_migrate/914496ed4ed4c415a017b81fa9c6b240.png)
(7.7)language:python
通过python编写的开源项目
![3473552bcbd200587530d87ba37cfd57.png](https://i-blog.csdnimg.cn/blog_migrate/bc9a58d154d374a5ed07e1e0950cca52.png)
8、通过高级搜索更准确寻找项目https://github.com/search/advanced
![e28717711b9325af9d54e25f613d63ce.png](https://i-blog.csdnimg.cn/blog_migrate/14c164419edbb96b4c74be17bd4cc757.png)
参考来源:csdn
链接: https:// blog.csdn.net/TimEcho/a rticle/details/106301793
链接: https:// blog.csdn.net/wqy183715 4675/article/details/103109740