2020国产成人精品视频,性做久久久久久久久,亚洲国产成人久久综合一区,亚洲影院天堂中文av色

分享

鮮為人知的 GitHub 使用技巧

 集微筆記 2014-04-23

GitHub 大家常上吧?可是使用 GitHub 的各種小竅門你就不一定知道了。本文將各種使用 GitHub 的小竅門分享給大家。

diff時(shí)忽略空格

有些修改只是增減了空格,在URL中添加?w=1就可以忽略。

查看某個(gè)作者的提交歷史

在URL中添加?author=username,例如:

  1. https://github.com/rails/rails/commits/master?author=dhh 

比較版本

使用類似如下的URL比較分支:

  1. https://github.com/rails/rails/compare/master...4-1-stable 

同樣可以使用一下格式:

  1. https://github.com/rails/rails/compare/master@{1.day.ago}...master 
  2. https://github.com/rails/rails/compare/master@{2014-10-04}...master 

如果想和派生倉庫比較,加上派生倉庫名作前綴即可:

  1. https://github.com/rails/rails/compare/byroot:master...master 

通過 HTML 方式嵌入 Gist

Gists是 GitHub 推出的基于 Git 的代碼片段服務(wù)。Gists頁面提供JavaScript代碼,可以將 Gist 嵌入到其他站點(diǎn)。但是很多站點(diǎn)粘貼 JavaScript 無效,這時(shí)候你可以在 Gist URL 后附加.pibb,得到一個(gè)純 HTML 的版本,然后就可以復(fù)制粘貼 HTML 源碼到其他網(wǎng)站了。例如 https://gist.github.com/tiimgreen/10545817.pibb

Git.io

Git.io 是適用于 GitHub 的短網(wǎng)址服務(wù)。

當(dāng)然,為了方便,也可以使用Curl訪問:

  1. $ curl -i http:// -F "url=https://github.com/..." 
  2. HTTP/1.1 201 Created 
  3. Location: http:///abc123 
  4.   
  5. $ curl -i http:///abc123 
  6. HTTP/1.1 302 Found 
  7. Location: https://github.com/... 

你甚至可以指定短網(wǎng)址的字段:

  1. $ curl -i http:// -F "url=https://github.com/technoweenie" \ 
  2.     -F "code=t
  3. HTTP/1.1 201 Created 
  4. Location: http:///t 

高亮行

例如,在 URL 中加上 #L52 可以高亮第52行?;蛘吣阋部梢灾苯狱c(diǎn)擊行數(shù)。

多行高亮同樣支持。你可以使用類似#L53-L60格式,或者在按住shift的同時(shí)點(diǎn)擊。

  1. https://github.com/rails/rails/blob/master/activemodel/lib/active_model.rb#L53-L60 

快速引用

你可以選中別人的評論文字,然后按r,這些內(nèi)容會以引用的形式被復(fù)制在文本框中:

任務(wù)列表

在工單或合并請求中,你可以使用任務(wù)列表語法:

  1. - [ ] Be awesome 
  2. - [ ] Do stuff 
  3. - [ ] Sleep 

勾選之后,會更新 Markdown:

  1. - [x] Be awesome 
  2. - [x] Do stuff 
  3. - [ ] Sleep 

合并請求的 diff 和 patch

可以在 URL 后添加 .diff 和 .patch,以對應(yīng)的模式查看合并請求:

  1. https://github.com/tiimgreen/github-cheat-sheet/pull/15 
  2. https://github.com/tiimgreen/github-cheat-sheet/pull/15.diff 
  3. https://github.com/tiimgreen/github-cheat-sheet/pull/15.patch 

結(jié)果是純文本的:

  1. diff --git a/README.md b/README.md 
  2. index 88fcf69..8614873 100644 
  3. --- a/README.md) 
  4. +++ b/README.md 
  5. @@ -28,6 +28,7 @@ All the hidden and not hidden features of Git and GitHub. This cheat sheet was i 
  6.  - [Merged Branches](#merged-branches) 
  7.  - [Quick Licensing](#quick-licensing) 
  8.  - [TODO Lists](#todo-lists) 
  9. +- [Relative Links](#relative-links) 
  10.  - [.gitconfig Recommendations](#gitconfig-recommendations) 
  11.      - [Aliases](#aliases) 
  12.      - [Auto-correct](#auto-correct) 
  13. @@ -381,6 +382,19 @@ When they are clicked, they will be updated in the pure Markdown: 
  14.  - [ ] Sleep 
  15.   
  16. (...) 

編撰 SegmentFault
參考 github-cheat-sheet 

via : http://segmentfault.com/a/1190000000475547 


    本站是提供個(gè)人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多