Github使用技巧

Posted by TerenceHan on 2017-07-25

快捷键

t 搜索文件
gp (go to pull request) 跳转到pull request页面
gc (go to code) 跳转到code页面
s 定位搜索框
shift+? 查看所有快捷键

代码引用

文件网址#L行号-L行号

相当于添加了锚点

部署

git subtree push --prefix dist origin gh-pages 将dist部署到gh-page分支
/dist 目录需要被 git 记录,于是后面我们才可以用它作为子树(subtree),因此 /dist 不能被 .gitignore 规则排除
dist 代表子树所在的目录名
origin 是 remote name
gh-pages 是目标分支名称

回退一个版本

1
2
git reset --hard HEAD~1
git push --force