跳至主要內容

Github技巧

xlc520otherother大约 1 分钟约 321 字

Github技巧

1.搜索

github高级搜索功能

直接打开这里GitHub · Where software is builtopen in new window

或搜索后在搜索页面 language 下方打开(没找到更好的方法)

image-20220504225139153
image-20220504225139153

更多技巧可查看官方文档:

About searching on GitHub - GitHub Docsopen in new window

搜索代码 - GitHub Docsopen in new window

2.查找文件

在主页按“t”:查找文件

image-20220504225403858
image-20220504225403858

点进源代码后,按“l”:跳转到某一行

image-20220504225816271
image-20220504225816271

点击行号:

  1. 复制这行代码
  2. 生成永久链接
image-20220504225652318
image-20220504225652318

源代码中按“b”:查看文件的改动记录

image-20220504225932440
image-20220504225932440

键盘快捷键:

Picture
Picture

3.阅读代码技巧

代码跳转:

  1. 下载到本地
  2. 在线vscode:仓库详情界面按下“。”键,
image-20220504230504057
image-20220504230504057
image-20220504230630070
image-20220504230630070

4.在线运行项目

在项目地址前加上gitpod.io/#/前缀

https://github.com/nginx/nginx => https://gitpod.io/#/github.com/nginx/nginx

登陆:

image-20220504230740420
image-20220504230740420

加载:

image-20220504230844063
image-20220504230844063

运行:

image-20220504230956747
image-20220504230956747