鍍金池/ 教程/ Java/ Github 秘籍三
Github 秘籍三
Github 秘籍二
Git 資源
Github 秘籍一
Git 實(shí)用功能
Git 配置

Github 秘籍三

GitHub Pages 的元數(shù)據(jù)與插件支持

在 Jekyll 頁面和文章里,倉庫信息可在 site.github 命名空間下找到,也可以顯示出來,例如,使用 {{ site.github.project_title }}顯示項(xiàng)目標(biāo)題。

Jemoji 和 jekyll-mentions 插件為你的 Jekyll 文章和頁面增加了 emoji@mentions功能。

了解更多 GitHub Pages 的元數(shù)據(jù)和插件支持

查看 YAML 格式的元數(shù)據(jù)

許多博客站點(diǎn),比如基于 JekyllGitHub Pages ,都依賴于一些文章頭部的 YAML 格式的元數(shù)據(jù)。 Github 會(huì)將其渲染成一個(gè)水平表格,方便閱讀。

http://wiki.jikexueyuan.com/project/github-secret/images/gh23.png" alt="" />

進(jìn)一步了解 在文檔里查看 YAML 元數(shù)據(jù)

渲染表格數(shù)據(jù)

GitHub 支持將.csv(逗號(hào)分隔)和.tsv(制表符分隔)格式的文件渲染成表格數(shù)據(jù)。

http://wiki.jikexueyuan.com/project/github-secret/images/gh24.png" alt="" />

進(jìn)一步了解渲染表格數(shù)據(jù)

撤銷 Pull Request

合并一個(gè) Pull Request 之后,你可能會(huì)反悔:要么是這次 Pull Request 沒什么用處,要么是還不到合并的時(shí)候。

此時(shí)可以通過 Pull Request 中的 Revert 按鈕來撤銷一個(gè)已合并的 Pull Request 中的 commit。按下按鈕后將自動(dòng)生成一個(gè)進(jìn)行逆操作的 Pull Request。

http://wiki.jikexueyuan.com/project/github-secret/images/gh25.png" alt="" />

進(jìn)一步了解“撤銷”按鈕

Diffs

可渲染文檔的 Diffs

Commit 和 Pull Request 里包含有 Github 支持的可渲染文檔(比如 Markdown)會(huì)提供 source 和 rendered 兩個(gè)視圖功能。

http://wiki.jikexueyuan.com/project/github-secret/images/gh26.png" alt="" />

點(diǎn)擊 "rendered" 按鈕,看看改動(dòng)在渲染后的顯示效果。當(dāng)你添加、刪除或修改文本時(shí),渲染純文本視圖非常方便。

http://wiki.jikexueyuan.com/project/github-secret/images/gh27.png" alt="" />

進(jìn)一步了解渲染純文本視圖 Diffs

可比較的地圖數(shù)據(jù)

當(dāng)你在 GitHub 上查看一個(gè)包含地理數(shù)據(jù)的 commit 或 pull request時(shí),Github 將以可視化的方式對(duì)比版本之間的差異。

http://wiki.jikexueyuan.com/project/github-secret/images/gh2.gif" alt="" />

進(jìn)一步了解可比較的地圖數(shù)據(jù)

在 Diff 中展開查看更多的上下文

你可以通過點(diǎn)擊 diff 邊欄里的 unfold 按鈕來多顯示幾行上下文。你可以一直點(diǎn)擊 unfold 按鈕直到顯示了文件的全部?jī)?nèi)容。這個(gè)功能在所有 GitHub 的 diff 功能中都可以使用。

http://wiki.jikexueyuan.com/project/github-secret/images/gh3.gif" alt="" />

進(jìn)一步了解展開 Diff 上下文

獲取 Pull Request 的 diff 或 patch 文件

在 Pull Request 的 URL 后面加上.diff.patch的擴(kuò)展名就可以得到它的 diff 或 patch 文件,例如:

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

.diff擴(kuò)展會(huì)使用普通文本格式顯示如下內(nèi)容:

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

(...)

顯示圖片以及比較圖片

GitHub 可以顯示包括 PNG、JPG、GIF、PSD 在內(nèi)的多種圖片格式并提供了幾種方式來比較這些格式的圖片文件版本間的不同。

http://wiki.jikexueyuan.com/project/github-secret/images/gh4.gif" alt="" />

查看更多關(guān)于圖片顯示和比較

Hub

Hub 是一個(gè)對(duì) Git 進(jìn)行了封裝的命令行工具,可以幫助你更方便的使用 Github。

例如可以像下面這樣進(jìn)行克?。?/p>

$ hub clone tiimgreen/toc

查看更多 Hub 提供的超酷命令

貢獻(xiàn)者指南

在倉庫的根目錄添加一個(gè)名為 CONTRIBUTING 的文件后,貢獻(xiàn)者在新建 Issue 或 Pull Request 時(shí)會(huì)看到一個(gè)指向這個(gè)文件的鏈接。

http://wiki.jikexueyuan.com/project/github-secret/images/gh.jpg" alt="" />

進(jìn)一步了解貢獻(xiàn)者指南

Octicons

GitHubs 圖標(biāo)庫 (Octicons) 現(xiàn)已開源。

http://wiki.jikexueyuan.com/project/github-secret/images/gh28.png" alt="" />

進(jìn)一步了解 GitHub 圖標(biāo)庫

GitHub 資源

內(nèi)容 鏈接
探索 GitHub https://github.com/explore
GitHub 博客 https://github.com/blog
GitHub 幫助 https://help.github.com/
GitHub 培訓(xùn) http://training.github.com/
GitHub 開發(fā)者 https://developer.github.com/

GitHub 相關(guān)演講視頻

內(nèi)容 鏈接
How GitHub Uses GitHub to Build GitHub https://www.youtube.com/watch?v=qyz3jkOBbQY
Introduction to Git with Scott Chacon of GitHub https://www.youtube.com/watch?v=ZDR433b0HJY
How GitHub No Longer Works https://www.youtube.com/watch?v=gXD1ITW7iZI
Git and GitHub Secrets https://www.youtube.com/watch?v=Foz9yvMkvlA
More Git and GitHub Secrets https://www.youtube.com/watch?v=p50xsL-iVgU
上一篇:Git 實(shí)用功能下一篇:Git 資源