快轉到主要內容
  1. 文章/

Github Cheat Sheet

·9 分鐘

這是我今天幫忙 https://github.com/tiimgreen/github-cheat-sheet 做一個簡單繁體中文版本的 PR,其實只是把簡體中文版本稍微轉換一下而已~

不過其實這篇蠻有意思的,很多值得參考~

GitHub秘笈 #

Git 和 Github 秘笈,靈感來自於 Zach Holman 在 2012 年 Aloha Ruby Conference 和 2013 年 WDCNZ 上所做的演講:Git and GitHub Secrets(slides) 和 More Git and GitHub Secrets(slides)。

目錄 #

GitHub #

不比較空白字串 #

在任意 diff 頁面的 UR L後加上 ?w=1,可以去掉那些隻是空白字串的改動,使你能更專註於代碼改動。

Diff without whitespace

詳見 GitHub secrets.

調整 Tab 字串所代表的空格數 #

在 diff 或文件的 URL 後面加上 ?ts=4 ,這樣當顯示 tab 字串的長度時就會是 4 個空格的長度,不再是默認的 8 個空格。 ts 後面的數字還可以根據你個人的偏好進行修改。這個技巧不適用於 Gists,或者以 Raw 格式查看文件, 但有瀏覽器擴展插件可以幫你自動調整: Chrome 擴展Opera 擴展

下面以一個 Go 語言原始碼為例,看看在 URL 裡添加 ?ts=4 參數的效果。添加前:

Before, tab space example

… 添加後的樣子:

After, tab space example

查看使用者的全部 Commit 歷史 #

在 Commits 頁面 URL 後加上 ?author={user} 查看使用者全部的提交。

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

DHH commit history

深入了解提交視圖之間的區別

倉庫複製 #

當複製倉庫時可以不要那個.git後綴。

1
$ git clone https://github.com/tiimgreen/github-cheat-sheet

更多對 Git clone 命令的介紹.

###分支 ####將某個分支與其他所有分支進行比對

當你查看某個倉庫的分支(Branches)頁面(緊挨著 Commits 連接)時

https://github.com/{user}/{repo}/branches

你會看到一個包含所有未合併的分支的列表。

在這裡你可以訪問分支比較頁面或刪除某個分支。

Compare branches not merged into master in rails/rails repo - https://github.com/rails/rails/branches

比較分支 #

如果要在 GitHub 上直接比較兩個分支,可以使用如下形式的 URL :

https://github.com/{user}/{repo}/compare/{range}

其中 {range} = master...4-1-stable

例如:

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

Rails branch compare example

{range} 參數還可以使用下面的形式:

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

日期格式 YYYY-DD-MM

Another compare example

diffpatch 頁面裡也可以比較分支:

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

了解更多關於基於時間的 Commit 比較.

比較不同派生庫的分支 #

想要對派生倉庫(Forked Repository)之間的分支進行比較,可以使用如下的 URL:

https://github.com/user/repo/compare/{foreign-user}:{branch}...{own-branch}

例如:

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

Forked branch compare

Gists #

Gists 方便我們管理代碼片段,不必使用功能齊全的倉庫。

Gist

Gist 的 URL 後加上 .pibb像這樣)可以得到便於嵌入到其他網站 的 HTML 代碼。

Gists 可以像任何標準倉庫一樣被複製。

1
$ git clone https://gist.github.com/tiimgreen/10545817

Gists

這意味著你可以像 Github 倉庫一樣修改和更新 Gists :

1
2
3
4
$ git commit
$ git push
Username for 'https://gist.github.com':
Password for 'https://tiimgreen@gist.github.com':

但是, Gists 不支持目錄。所有文件都必須添加在倉庫的根目錄下。 進一步了解如何建立 Gists.

Git.io #

Git.io是 Github 的短網址服務。

Git.io

你可以通過 Curl 命令以普通 HTTP 協議使用它:

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

$ curl -i http://git.io/abc123
HTTP/1.1 302 Found
Location: https://github.com/...

進一步了解 Git.io.

鍵盤快捷鍵 #

在倉庫頁面上提供了快捷鍵方便快速導航。

  • t 鍵打開一個文件瀏覽器。
  • w 鍵打開分支選擇菜單。
  • s 鍵聚焦游標到當前倉庫的搜索框。此時按刪除鍵就會從搜索當前倉庫切換到搜索整個 Github 網站。
  • l 鍵編輯 Issue 列表頁的標籤。
  • 查看文件內容時(如:https://github.com/tiimgreen/github-cheat-sheet/blob/master/README.md),按 y 鍵將會凍結這個頁面,這樣就算代碼被修改了也不會影響你當前看到的。

?查看當前頁面支持的快捷鍵列表:

Keyboard shortcuts

進一步了解可用的搜索語法.

整行高亮 #

在代碼文件地址 URL 後加上#L52或者單擊行號 52 都會將第 52 行代碼高亮顯示。

多行高亮也可以,比如用#L53-L60選擇範圍,或者按住 shift 鍵,然後再點擊選擇的兩行。

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

整行高亮

用 Commit 訊息關閉 Issue #

如果某個提交修復了一個 Issue,當提交到 master 分支時,提交訊息裡可以使用 fix/fixes/fixed, close/closes/closed 或者 resolve/resolves/resolved 等關鍵詞,後面再跟上 Issue 號,這樣就會關閉這個 Issue 。

1
$ git commit -m "Fix screwup, fixes #12"

這將會關閉 Issue #12,並且在 Issue 討論列表裡關聯引用這次提交。

Closing Repo

進一步了解通過提交訊息關閉 Issue.

連接其他倉庫的 Issue #

如果你想引用到同一個倉庫中的一個 Issue,隻需使用井號 # 加上 Issue 號,這樣就會自動建立到此 Issue 的連接。

要連接到其他倉庫的 Issue ,就使用{user}/{repo}#ISSUE_NUMBER的方式,例如tiimgreen/toc#12

Cross-Link Issues

鎖定項目對話功能 #

現在倉庫的管理員和合作者可以將 Pull Requests 和 Issue 的評論功能關閉。

Lock conversation

這樣,不是項目合作者的使用者就不能在這個項目上使用評論功能。

Comments locked

進一步了解對話鎖定功能.

設置 CI 對每條 Pull Request 都進行構建 #

如果設置正確,Travis CI 會為每個你收到的 Pull Request 執行構建,就像每次提交也會觸發構建一樣。想了解更多關於 Travis CI 的訊息,請參考 Travis CI入門

Travis CI status

進一步了解提交狀態 API.

Markdown 文件語法高亮 #

例如,可以像下面這樣在你的 Markdown 文件裡為 Ruby 代碼添加語法高亮:

```ruby
require 'tabbit'
table = Tabbit.new('Name', 'Email')
table.add_row('Tim Green', 'tiimgreen@gmail.com')
puts table.to_s
```

效果如下:

1
2
3
4
require 'tabbit'
table = Tabbit.new('Name', 'Email')
table.add_row('Tim Green', 'tiimgreen@gmail.com')
puts table.to_s

Github使用 Linguist 做語言識別和語法高亮。你可以仔細閱讀 languages YAML file,了解有哪些可用的關鍵字。

進一步了解 GitHub Flavored Markdown.

表情符號 #

可以在 Pull Requests, Issues, 提交消息, Markdown 文件裡加入表情符號。使用方法 :name_of_emoji:

😄

將輸出一個笑臉:

😄

Github 支持的完整表情符號號列表詳見emoji-cheat-sheet.comscotch-io/All-Github-Emoji-Icons

Github 上使用最多的5個表情符號號是:

  1. :shipit:
  2. 👎
  3. 👍
  4. 👏

圖片 / GIF 動畫 #

註解和README等文件裡也可以使用圖片和 GIF 動畫:

![Alt Text](http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif)

倉庫中的圖片可以被直接引用:

![Alt Text](https://github.com/{user}/{repo}/raw/master/path/to/image.gif)

Peter don’t care

所有圖片都緩存在 Github,不用擔心你的網站不能訪問時就看不到圖片了。

在 GitHub Wiki 中引用圖片 #

有多種方法可以在 Wiki 頁面裡嵌入圖片。既可以像上一條裡那樣使用標準的 Markdown 語法,也可以像下面這樣指定圖片的高度或寬度:

1
[[ http://www.sheawong.com/wp-content/uploads/2013/08/keephatin.gif | height = 100px ]]

結果:

Just a screenshot

快速引用 #

在主題評論中引用之前某個人所說的,只需選中文件,然後按 r 鍵,想要的就會以引用的形式複製到你的輸入框裡。

Quick Quote

進一步了解快速引用.

複製貼上剪貼板中的圖片到評論 #

(僅適用於 Chrome 瀏覽器)

當截屏圖片複製到剪貼板後(mac 上用 cmd-ctrl-shift-4),你可以用(cmd-v / ctrl-v)把圖片複製貼上到評論框裡,然後它就會自動上傳到 Github。

Pasting Clipboard Image to Comments

進一步了解在 issue 中使用附件

快速添加許可證文件 #

建立一個倉庫時,Github會為你提供一個預設的軟體授權條款:

License

對於已有的倉庫,可以通過 web 界面建立文件來添加軟體授權條款。輸入LICENSE作為文件名後,同樣可以從預設的列表中選擇一個作為模板。

License

這個技巧也適用於 .gitignore 文件。

進一步了解開源許可證

任務列表 #

Issues 和 Pull requests 裡可以添加複選框,語法如下(註意空白符):

- [ ] Be awesome
- [ ] Prepare dinner
  - [ ] Research recipe
  - [ ] Buy ingredients
  - [ ] Cook recipe
- [ ] Sleep

Task List

當項目被選中時,它對應的 Markdown 原始碼也被更新了:

- [x] Be awesome
- [ ] Prepare dinner
  - [x] Research recipe
  - [x] Buy ingredients
  - [ ] Cook recipe
- [ ] Sleep

進一步了解任務列表.

Markdown 文件中的任務列表 #

在完全符合Markdown語法的文件中可以使用以下語法加入一個只讀的任務列表

- [ ] Mercury
- [x] Venus
- [x] Earth
  - [x] Moon
- [x] Mars
  - [ ] Deimos
  - [ ] Phobos
  • Mercury
  • Venus
  • Earth
    • Moon
  • Mars
    • Deimos
    • Phobos

進一步了解 Markdown 文件中的任務列表

相對連接 #

Markdown文件裡連接到內部內容時推薦使用相對連接。

1
2
[Link to a header](#awesome-section)
[Link to a file](docs/readme)

絕對連接會在 URL 改變時(例如重新命名倉庫、使用者名稱改變,建立分支項目)被更新。使用相對連接能夠保證你的文件不受此影響。

進一步了解相對連接.

GitHub Pages 的中繼資料與插件支持 #

在 Jekyll 頁面和文章裡,倉庫訊息可在 site.github 命名空間下找到,也可以顯示出來,例如,使用 {{ site.github.project_title }}顯示項目標題。

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

了解更多 GitHub Pages 的中繼資料和插件支持.

查看 YAML 格式的中繼資料 #

許多博客網站,比如基於 JekyllGitHub Pages ,都依賴於一些文章頭部的 YAML 格式的中繼資料。 Github 會將其渲染成一個水平表格,方便閱讀。

YAML metadata

進一步了解 在文件裡查看 YAML 中繼資料.

渲染表格數據 #

GitHub 支持將 .csv (逗號分隔)和 .tsv (定位點分隔)格式的文件渲染成表格數據。

Tabular data

進一步了解渲染表格數據.

撤銷 Pull Request #

合併一個 Pull Request 之後,你可能會反悔:要麼是這次 Pull Request 沒什麼用處,要麼是還不到合併的時候。

此時可以通過 Pull Request 中的 Revert 按鈕來撤銷一個已合併的 Pull Request 中的 commit。按下按鈕後將自動生成一個進行逆操作的 Pull Request。

Revert button

*進一步了解「撤銷」按鈕

Diffs #

可渲染文件的Diffs #

Commit 和 Pull Request 裡包含有 Github 支持的可渲染文件(比如 Markdown)會提供sourcerendered 兩個視圖功能。

Source / Rendered view

點擊 “rendered” 按鈕,看看改動在渲染後的顯示效果。當你添加、刪除或修改文件時,渲染純文件視圖非常方便。

Rendered Prose Diffs

進一步了解渲染純文件視圖Diffs.

可比較的地圖數據 #

當你在GitHub上查看一個包含地理數據的 commit 或 pull request時,Github 將以可視化的方式比對版本之間的差異。

Diffable Maps

進一步了解可比較的地圖數據.

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

你可以通過點擊 diff 邊欄裡的 unfold 按鈕來多顯示幾行上下文。你可以一直點擊 unfold 按鈕直到顯示了文件的全部內容。這個功能在所有 GitHub 的 diff 功能中都可以使用。

Expanding Context in Diffs

進一步了解展開 Diff 上下文.

獲取 Pull Request 的 diff 或 patch 文件 #

在 Pull Request 的 URL 後面加上 .diff.patch 的擴展名就可以得到它的 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 擴展會使用普通文件格式顯示如下內容:

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 在內的多種圖片格式並提供了幾種方式來比較這些格式的圖片文件版本間的不同。

Diffable PSD

查看更多關於圖片顯示和比較

Hub #

Hub 是一個對 Git 進行了封裝的命令行工具,可以幫助你更方便的使用 Github。

例如可以像下面這樣進行複製:

1
$ hub clone tiimgreen/toc

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

貢獻者指南 #

在倉庫的根目錄添加一個名為 CONTRIBUTING 的文件後,貢獻者在新建 Issue 或 Pull Request 時會看到一個指向這個文件的連接。

Contributing Guidelines

進一步了解貢獻者指南.

Octicons #

GitHubs 圖標庫 (Octicons) 現已開源。

Octicons

進一步了解 GitHub 圖標庫

GitHub 資源 #

內容連接
探索 GitHubhttps://github.com/explore
GitHub 博客https://github.com/blog
GitHub 幫助https://help.github.com/
GitHub 培訓http://training.github.com/
GitHub 開發者https://developer.github.com/

GitHub 相關演講視頻 #

內容連接
How GitHub Uses GitHub to Build GitHubhttps://www.youtube.com/watch?v=qyz3jkOBbQY
Introduction to Git with Scott Chacon of GitHubhttps://www.youtube.com/watch?v=ZDR433b0HJY
How GitHub No Longer Workshttps://www.youtube.com/watch?v=gXD1ITW7iZI
Git and GitHub Secretshttps://www.youtube.com/watch?v=Foz9yvMkvlA
More Git and GitHub Secretshttps://www.youtube.com/watch?v=p50xsL-iVgU

Git #

從工作區去除大量已刪除文件 #

當用 /bin/rm 命令刪除了大量文件之後,你可以用下面一條命令從工作區和索引中去除這些文件,以免一個一個的刪除:

1
$ git rm $(git ls-files -d)

例如:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
$ git status
On branch master
Changes not staged for commit:
	deleted:    a
	deleted:    c

$ git rm $(git ls-files -d)
rm 'a'
rm 'c'

$ git status
On branch master
Changes to be committed:
	deleted:    a
	deleted:    c

上一個分支 #

快速檢出上一個分支:

1
2
3
4
5
6
7
8
$ git checkout -
# Switched to branch 'master'

$ git checkout -
# Switched to branch 'next'

$ git checkout -
# Switched to branch 'master'

進一步了解 Git 分支.

去除空白 #

Git Stripspace 命令可以:

  • 去掉行尾空白符
  • 多個空行壓縮成一行
  • 必要時在文件末尾增加一個空行

使用此命令時必須傳入一個文件,像這樣:

1
$ git stripspace < README.md

進一步了解 Git stripspace 命令.

檢出 Pull Requests #

對 Github 倉庫來說,Pull Request 是種特殊分支, 可以通過以下多種方式取到本地:

取出某個特定的 Pull Request 並臨時作為本地的 FETCH_HEAD 中以便進行快速查看更改( diff )以及合併( merge ):

1
$ git fetch origin refs/pull/[PR-Number]/head

通過 refspec 獲取所有的 Pull Request 為本地分支:

1
$ git fetch origin '+refs/pull/*/head:refs/remotes/origin/pr/*'

或在倉庫的 .git/config 中加入下列設置來自動獲取遠程倉庫中的 Pull Request

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = git@github.com:tiimgreen/github-cheat-sheet.git
[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = git@github.com:tiimgreen/github-cheat-sheet.git
    fetch = +refs/pull/*/head:refs/remotes/origin/pr/*

對基於派生庫的 Pull Request,可以通過先 checkout 代表此 Pull Request 的遠端分支再由此分支建立一個本地分支:

1
$ git checkout pr/42 pr-42

操作多個倉庫的時候,可以在 Git 中設置獲取 Pull Request 的全局選項。

1
git config --global --add remote.origin.fetch "+refs/pull/*/head:refs/remotes/origin/pr/*"

此時可以在任意倉庫中使用以下命令:

1
 git fetch origin
1
git checkout pr/42

進一步了解如何本地檢出 pull request.

沒有任何改動的提交 #

可以使用--allow-empty選項強製建立一個沒有任何改動的提交:

1
$ git commit -m "Big-ass commit" --allow-empty

這樣做在如下幾種情況下是有意義的:

  • 標記新的工作或一個新功能的開始。
  • 記錄對項目的跟代碼無關的改動。
  • 跟使用你倉庫的其他人交流。
  • 作為倉庫的第一次提交,因為第一次提交後不能被 rebase: git commit -m "init repo" --allow-empty.

It ain’t even that trolololol…

美化 Git Status #

在命令行輸入如下命令:

1
$ git status

可以看到:

git status

加上-sb選項:

1
$ git status -sb

這會得到:

git status -sb

進一步了解 Git status 命令.

美化 Git Log #

輸入如下命令:

1
$ git log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative

可以看到:

git log –all –graph –pretty=format:’%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset’ –abbrev-commit –date=relative

這要歸功於 Palesz 在 stackoverflow 的回答。

這個命令可以被用作別名,詳細做法見這裡

進一步了解 Git log 命令.

Git 查詢 #

Git 查詢運行你在之前的所有提交訊息裡進行搜索,找到其中和搜索條件相匹配的最近的一條。

1
$ git show :/query

這裡 query (區別大小寫)是你想要搜索的詞語, 這條命令會找到包含這個詞語的最後那個提交並顯示變動詳情。

1
$ git show :/typo

git show :/query

  • q 鍵退出命令。*

合併分支 #

輸入命令:

1
$ git branch --merged

這會顯示所有已經合併到你當前分支的分支列表。

相反地:

1
$ git branch --no-merged

會顯示所有還沒有合併到你當前分支的分支列表。

進一步了解 Git branch 命令.

修復有問題的提交以及自動合併 #

如果上一個或多個提交包含了錯誤,可以在你修復問題後使用下列命令處理(假設要修復的提交版本是abcde):

1
2
$ git commit --fixup=abcde
$ git rebase abcde^ --autosquash -i

進一步了解 Git commit 命令. 進一步了解 Git rebase 命令.

以網站方式查看本地倉庫 #

使用 Git 的 instaweb 可以立即在 gitweb 中瀏覽你的工作倉庫。這個命令是個簡單的腳本,設置了 gitweb 和用來瀏覽本地倉庫的Web服務器。(譯者註:默認需要lighttpd支持)

1
$ git instaweb

執行後打開:

Git instaweb

進一步了解 Git instaweb 命令.

Git 設置 #

所有 Git 設置都保存在你的 .gitconfig 文件中。

Git 命令自定義別名 #

別名用來幫助你定義自己的 git 命令。比如你可以定義 git a 來運行 git add --all

要添加一個別名, 一種方法是打開 ~/.gitconfig 文件並添加如下內容:

[alias]
  co = checkout
  cm = commit
  p = push
  # Show verbose output about tags, branches or remotes
  tags = tag -l
  branches = branch -a
  remotes = remote -v

…或者在命令行裡鍵入:

1
$ git config --global alias.new_alias git_function

例如:

1
$ git config --global alias.cm commit

指向多個命令的別名可以用引號來定義:

1
$ git config --global alias.ac 'add -A . && commit'

下面列出了一些有用的別名:

別名 Alias命令 Command如何設置 What to Type
git cmgit commitgit config --global alias.cm commit
git cogit checkoutgit config --global alias.co checkout
git acgit add . -A git commitgit config --global alias.ac '!git add -A && git commit'
git stgit status -sbgit config --global alias.st 'status -sb'
git tagsgit tag -lgit config --global alias.tags 'tag -l'
git branchesgit branch -agit config --global alias.branches 'branch -a'
git cleanup`git branch –mergedgrep -v ‘*’
git remotesgit remote -vgit config --global alias.remotes 'remote -v'
git lggit log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"

自動更正 #

如果鍵入 git comit 你會看到如下輸出:

1
2
3
4
5
$ git comit -m "Message"
# git: 'comit' is not a git command. See 'git --help'.

# Did you mean this?
#   commit

為了在鍵入 comit 調用 commit命令,隻需啟用自動糾錯功能:

1
$ git config --global help.autocorrect 1

現在你就會看到:

1
2
3
4
$ git comit -m "Message"
# WARNING: You called a Git command named 'comit', which does not exist.
# Continuing under the assumption that you meant 'commit'
# in 0.1 seconds automatically...

顏色輸出 #

要在你的 Git 命令輸出裡加上顏色的話,可以用如下命令:

1
$ git config --global color.ui 1

進一步了解 Git config 命令.

Git 資源 #

TitleLink
Official Git Sitehttp://git-scm.com/
Official Git Video Tutorialshttp://git-scm.com/videos
Code School Try Githttp://try.github.com/
Introductory Reference & Tutorial for Githttp://gitref.org/
Official Git Tutorialhttp://git-scm.com/docs/gittutorial
Everyday Githttp://git-scm.com/docs/everyday
Git Immersionhttp://gitimmersion.com/
Ry’s Git Tutorialhttp://rypress.com/tutorials/git/index.html
Git for Designerhttp://hoth.entp.com/output/git_for_designers.html
Git for Computer Scientistshttp://eagain.net/articles/git-for-computer-scientists/
Git Magichttp://www-cs-students.stanford.edu/~blynn/gitmagic/
GitHub Training Kithttp://training.github.com/kit
Git Visualization Playgroundhttp://onlywei.github.io/explain-git-with-d3/#freeplay

Git 參考書籍 #

TitleLink
Pragmatic Version Control Using Githttp://www.pragprog.com/titles/tsgit/pragmatic-version-control-using-git
Pro Githttp://git-scm.com/book
Git Internals Peepcodehttp://peepcode.com/products/git-internals-pdf
Git in the Trencheshttp://cbx33.github.com/gitt/
Version Control with Githttp://www.amazon.com/Version-Control-Git-collaborative-development/dp/1449316387
Pragmatic Guide to Githttp://www.pragprog.com/titles/pg_git/pragmatic-guide-to-git
Git: Version Control for Everyonehttp://www.packtpub.com/git-version-control-for-everyone/book