Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub新姿势强势解锁 #21

Open
zhaoqize opened this issue Feb 12, 2018 · 0 comments
Open

GitHub新姿势强势解锁 #21

zhaoqize opened this issue Feb 12, 2018 · 0 comments
Labels

Comments

@zhaoqize
Copy link
Owner

zhaoqize commented Feb 12, 2018

键盘快捷键

在 GitHub 中,很多页面都可以使用键盘快捷键。在各个页面按下 shift + / 都可以打开键盘快捷键一览表。
image

通过部分名称搜索文件

在仓库页面试着按下键盘的 t 键,然后输入要找的目录或文件的部分名称,就可以快速的在仓库进行文件筛选了。
比如在https://github.com/zhaoqize/blog这个页面按下键盘 t
image

查看分支间的差别

在 GitHub 上,通过直接修改 URL 就可以让用户以多种形式查看分支差别。
比如我想查看 master 分支与 dev 分支的差别

https://github.com/Neilpang/acme.sh/compare/master...dev

image

查看指定日期之间的差别
查看master分支 2018-01-01 与现在的差别

https://github.com/Neilpang/acme.sh/compare/master@{2018-01-01}...master

查看几天前的差别
查看master分支最近1天内的差别

  • day
  • week
  • month
  • year

指定期间有上面这几种

https://github.com/Neilpang/acme.sh/compare/master@{1.day.go}...master

添加贡献规则

在Issue时候,经常会看到这个提示
image
只需要在仓库根目录下添加 CONTRIBUTING.md 文件后该链接就会显示出来。

GitHub 中可使用的描述方法并不止“@ 用户名”一种

  • 输入“@ 组织名”可以让属于该 Organization(组织)的所 有成员收到通知。
  • 输入“@ 团队名”可以让该团队的所有成员 收到通知。这就是同时向多人发送通知的方法。
  • 输入“# 编号”,会连接到该仓库所对应的 Issue 编号。
  • 输入 “用户名 / 仓库名 # 编号”则可以连接到指定仓库所对应的 Issue 编号。只要按照这类特定格式书写便会自动创建链接。

自动引用评论

我们可能经常性的在Issue中与别人讨论,会遇到想要引用别人的话语,这时候我们只需要选中想要引用的评论然后按 R 健即可。
image

行号定位

文件内容的左侧会显示该文件的行号。假如我们点击第 10 行的行 号,这一行就会被高亮标记为黄色,同时 URL 末尾会自动添加“#L10”。使用这个 URL,程序员们在交流时,就可以将讨论明确指向 某一行。另外,如果将“ # L10”改成“ # L10-15”,则会标记该文件的第 10~15 行。
image
image

另外推荐一个Git 基本操作的网站:learngitbranching

@zhaoqize zhaoqize changed the title GitHub的新姿势解锁 GitHub新姿势强势解锁 Feb 12, 2018
@zhaoqize zhaoqize added the Blog label Feb 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant