mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 08:50:06 +02:00
update some punctuation
This commit is contained in:
parent
8ce93006b8
commit
1a53e51610
15 changed files with 118 additions and 118 deletions
|
@ -81,13 +81,13 @@ exports.level = {
|
||||||
"",
|
"",
|
||||||
"Remote (遠端) repository 並不會很難了解. 藉由現在的雲端運算,可以很輕易地了解到在 git remotes 裡面有很多有趣的事情,但它們其實其實就只是你的或者是其它電腦上的 repository 的副本。你可以輕易地透過網路去發送你的 commit 給其它的電腦。",
|
"Remote (遠端) repository 並不會很難了解. 藉由現在的雲端運算,可以很輕易地了解到在 git remotes 裡面有很多有趣的事情,但它們其實其實就只是你的或者是其它電腦上的 repository 的副本。你可以輕易地透過網路去發送你的 commit 給其它的電腦。",
|
||||||
"",
|
"",
|
||||||
"也就是說, remote repository 有很多有趣的地方:",
|
"也就是說, remote repository 有很多有趣的地方:",
|
||||||
"",
|
"",
|
||||||
"- 第一,remote 是用來備份的! 本地端的 git 有能力可以回復文件到前一個狀態 (你知道的),但是全部的資訊還是儲存在本地端。如果你在其它的電腦上面有你的 git repository 的副本,則你可以在資料不小心遺失的時候進行救援備份",
|
"- 第一,remote 是用來備份的! 本地端的 git 有能力可以回復文件到前一個狀態 (你知道的),但是全部的資訊還是儲存在本地端。如果你在其它的電腦上面有你的 git repository 的副本,則你可以在資料不小心遺失的時候進行救援備份",
|
||||||
"",
|
"",
|
||||||
"- 更重要的是, remotes 讓大家一起來 coding! 現在你的 project 放在 remote 上面,你的朋友可以很容易地對你的 project 做出貢獻 (或者是 pull 你最後的修改) 。",
|
"- 更重要的是, remotes 讓大家一起來 coding!現在你的 project 放在 remote 上面,你的朋友可以很容易地對你的 project 做出貢獻(或者是 pull 你最後的修改) 。",
|
||||||
"",
|
"",
|
||||||
"使用網站去對 remote repository 做視覺化非常流行 (例如 [Github](https://github.com/) 或者是 [Phabricator](http://phabricator.org/)),但這背後最大的功臣是 remote repository,因此我們務必要了解它。"
|
"使用網站去對 remote repository 做視覺化非常流行(例如 [Github](https://github.com/) 或者是 [Phabricator](http://phabricator.org/)),但這背後最大的功臣是 remote repository,因此我們務必要了解它。"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -97,9 +97,9 @@ exports.level = {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"## 我們去建立 remotes 的指令",
|
"## 我們去建立 remotes 的指令",
|
||||||
"",
|
"",
|
||||||
"到目前為止,Learn Git Branching 著重在本地端的工作 (branching, merging, rebasing 以及其它指令), 但是我們現在想要學習針對 remote 的指令,我們需要一個指令去建立環境,`git clone` 就是我們需要的指令",
|
"到目前為止,Learn Git Branching 著重在解釋本地端的工作(branching, merging, rebasing 以及其它指令), 但是我們現在想要學習針對 remote 的指令,我們需要一個指令去建立環境,`git clone` 就是我們需要的指令",
|
||||||
"",
|
"",
|
||||||
"技術上來說, `git clone` 表示你想要把遠端的 repository 複製一份下來放在本地端 ( 例如從 github 複製)。 雖然 `git clone` 實際上是把遠端的 repository 複製下來放在本地端,在 Learn Git Branching 中,我們用的這個 command 會有一點不同。雖然他跟真實的 command 的意思相反,但是它可以建立起本地端以及遠端的一個連結,現在讓我們看看如何使用它吧。",
|
"技術上來說, `git clone` 表示你想要把遠端的 repository 複製一份下來放在本地端( 例如從 github 複製)。 雖然 `git clone` 實際上是把遠端的 repository 複製下來放在本地端,在 Learn Git Branching 中,我們用的這個指令會有一點不同。雖然他跟真實的指令的意思相反,但是它可以建立起本地端以及遠端的一個連結,現在讓我們看看如何使用它吧。",
|
||||||
""
|
""
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -108,11 +108,11 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"讓我們慢慢來,並且看看 remote repository 是長什麼樣子 (在我們的視覺化圖形中)。",
|
"讓我們慢慢來,並且看看 remote repository 是長什麼樣子(在我們的視覺化圖形中)。",
|
||||||
""
|
""
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"就是那樣! 現在我們有了一個放置了我們 project 的 remote repository。除了一些視覺上的改變之外,它們看起來很像,在之後的關卡中你就會看到我們如何分享我們的工作到這些 repository 上面。"
|
"就是那樣!現在我們有了一個放置了我們 project 的 remote repository。除了一些視覺上的改變之外,它們看起來很像,在之後的關卡中你就會看到我們如何分享我們的工作到這些 repository 上面。"
|
||||||
],
|
],
|
||||||
"command": "git clone",
|
"command": "git clone",
|
||||||
"beforeCommand": ""
|
"beforeCommand": ""
|
||||||
|
@ -122,7 +122,7 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"要完成這個關卡,只要打 `git clone`。其它的學習會在後面的關卡中出現"
|
"要完成這個關卡,只要打 `git clone,其它的學習會在後面的關卡中出現。"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,11 +77,11 @@ exports.level = {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"## 模擬合作",
|
"## 模擬合作",
|
||||||
"",
|
"",
|
||||||
"接下來的課程有一個很難的事情,我們需要讓你學會如何 pull reomote 上的更新 。",
|
"接下來的課程有一個很難的事情,我們需要讓你學會如何 pull remote 上的更新 。",
|
||||||
"",
|
"",
|
||||||
"這就表示我們必須要 \"假裝\" remote 被你其中一個同事/ 朋友/ 合作的人在某個特定的 branch 上面送了一些特定的 commit。",
|
"這就表示我們必須要 \"假裝\" remote 被你其中一個同事/ 朋友/ 合作的人在某個特定的 branch 上面送了一些特定的 commit。",
|
||||||
"",
|
"",
|
||||||
"為了要做到這件事情,我們要介紹一個自己設計的指令 `git fakeTeamwork`! 從字面上就可以很容易地看出來它在幹嘛,讓我們來看一個範例‧‧‧"
|
"為了要做到這件事情,我們要介紹一個自己設計的指令 `git fakeTeamwork`! 從字面上就可以很容易地看出來它在幹嘛,讓我們來看一個範例..."
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -92,7 +92,7 @@ exports.level = {
|
||||||
"`fakeTeamwork` 的預設行為是在送一個 commit 給 master 分支"
|
"`fakeTeamwork` 的預設行為是在送一個 commit 給 master 分支"
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"我就說吧 -- remote 已經藉由一個新的 commit 而更新了,而且因為我們還沒有用 `git fetch`,所以表示我們還沒有下載該更新。."
|
"我就說吧!remote 已經藉由一個新的 commit 而更新了,而且因為我們還沒有用 `git fetch`,所以表示我們還沒有下載該 commit。."
|
||||||
],
|
],
|
||||||
"command": "git fakeTeamwork",
|
"command": "git fakeTeamwork",
|
||||||
"beforeCommand": "git clone"
|
"beforeCommand": "git clone"
|
||||||
|
@ -105,7 +105,7 @@ exports.level = {
|
||||||
"你可以在命令的後面指定你要送幾個 commit 或是要送給哪個 branch。"
|
"你可以在命令的後面指定你要送幾個 commit 或是要送給哪個 branch。"
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"我們利用一個 command 將三個 commit 送給在 remote 上面的 `foo` branch。"
|
"我們利用一個指令將三個 commit 送給在 remote 上面的 `foo` branch。"
|
||||||
],
|
],
|
||||||
"command": "git fakeTeamwork foo 3",
|
"command": "git fakeTeamwork foo 3",
|
||||||
"beforeCommand": "git branch foo; git clone"
|
"beforeCommand": "git branch foo; git clone"
|
||||||
|
@ -117,7 +117,7 @@ exports.level = {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"接下來的關卡會很困難,所以我們在這個關卡中會問你更多問題。",
|
"接下來的關卡會很困難,所以我們在這個關卡中會問你更多問題。",
|
||||||
"",
|
"",
|
||||||
"現在先把 remote 下載下來 (利用 `git clone`),假裝送幾個 commit 給 remote 做更新,然後 pull 這些 commit 下來 。這就好像是幾個教學中的命令的總結!"
|
"現在先把 remote 下載下來(利用 `git clone`),假裝送幾個 commit 給 remote 做更新,然後 pull 這些 commit 下來 。這就好像是幾個教學中的指令的總結!"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,9 +96,9 @@ exports.level = {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"## Git Fetch",
|
"## Git Fetch",
|
||||||
"",
|
"",
|
||||||
"透過 git remotes 其實就是把資料接收或傳送到其它的 repository,只要我們可以將資料傳進及傳出,我們就可以分享任何被 git 所追蹤的 repository 的更新 (例如分享工作進度,新的檔案,新的想法,以及情書等等‧‧‧)。",
|
"透過 git remotes 其實就是把資料接收或傳送到其它的 repository,只要我們可以將資料傳進及傳出,我們就可以分享任何被 git 所追蹤的 repository 的更新(例如分享工作進度,新的檔案,新的想法,以及情書等等...)。",
|
||||||
"",
|
"",
|
||||||
"在這個教學中,我們會學習到如何從 remote repository 來 fetch (抓取) 資料,這個 command 叫作 `git fetch`。",
|
"在這個教學中,我們會學習到如何從 remote repository 來 fetch (抓取)資料,這個指令叫作 `git fetch`。",
|
||||||
"",
|
"",
|
||||||
"你將會注意到當我們的 remote repository 更新的時候,相對應的 _remote_ branch 也會反應該更新,這個跟我們之前所提到的 remote branch 的特性是吻合的。"
|
"你將會注意到當我們的 remote repository 更新的時候,相對應的 _remote_ branch 也會反應該更新,這個跟我們之前所提到的 remote branch 的特性是吻合的。"
|
||||||
]
|
]
|
||||||
|
@ -111,7 +111,7 @@ exports.level = {
|
||||||
"在講到 `git fetch` 的細節之前,我們要先來看一下例子! 在這裡我們有一個包含了兩個 commit 的 remote repository,而且我們的 local repository 並沒有包含這兩個 commit。"
|
"在講到 `git fetch` 的細節之前,我們要先來看一下例子! 在這裡我們有一個包含了兩個 commit 的 remote repository,而且我們的 local repository 並沒有包含這兩個 commit。"
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"看吧! commits `C2` and `C3` 已經被下載到我們的 local repository,而且我們的 remote branch `o/master` 也更新了。"
|
"看吧!commits `C2` 以及 `C3` 已經被下載到我們的 local repository,而且我們的 remote branch `o/master` 也更新了。"
|
||||||
],
|
],
|
||||||
"command": "git fetch",
|
"command": "git fetch",
|
||||||
"beforeCommand": "git clone; git fakeTeamwork 2"
|
"beforeCommand": "git clone; git fakeTeamwork 2"
|
||||||
|
@ -123,16 +123,16 @@ exports.level = {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"### fetch 做了什麼",
|
"### fetch 做了什麼",
|
||||||
"",
|
"",
|
||||||
"`git fetch` 只有執行了兩個主要步驟。包含:",
|
"`git fetch` 只有執行了兩個主要步驟,包含:",
|
||||||
"",
|
"",
|
||||||
"* 下載 remote 有的 commit,但是在我們的 local repository 是沒有該 commit。還有‧‧‧",
|
"* 下載 remote 有的 commit,但是在我們的 local repository 是沒有該 commit。還有‧‧‧",
|
||||||
"* 更新我們 remote branch 所指向的地方 (例如, `o/master`)",
|
"* 更新我們 remote branch 所指向的地方(例如, `o/master`)",
|
||||||
"",
|
"",
|
||||||
"基本上,`git fetch` 同步了我們的 local repository 以及 remote repository 的最新狀態。",
|
"基本上,`git fetch` 同步了我們的 local repository 以及 remote repository 的最新狀態。",
|
||||||
"",
|
"",
|
||||||
"假如你還記得之前的教學的話,我們說過 remote branch 反應了 remote repository 的狀態,原因在於說你最後接觸的是這些 remote repository,而你就是利用 `git fetch` 來接觸這些 remote repository! 現在 remote branch 跟 `git fetch` 的關係已經很明顯了。",
|
"假如你還記得之前的教學的話,我們說過 remote branch 反應了 remote repository 的狀態,原因在於說你最後接觸的是這些 remote repository,而你就是利用 `git fetch` 來接觸這些 remote repository!現在 remote branch 跟 `git fetch` 的關係已經很明顯了。",
|
||||||
"",
|
"",
|
||||||
"`git fetch` 通常是透過網路來跟 remote 溝通。(透過一個 protocol (協定),例如 `http://` 或者是 `git://`).",
|
"`git fetch` 通常是透過網路來跟 remote 溝通(透過一個 protocol (協定),例如 `http://` 或者是 `git://`)。",
|
||||||
""
|
""
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"### fetch 沒有做什麼",
|
"### fetch 沒有做的事情",
|
||||||
"",
|
"",
|
||||||
"然而,`git fetch` 並不會影響到在你的 local repository 中的 `master` branch,他並不會將你的 `master` branch 更新到最新的狀態。",
|
"然而,`git fetch` 並不會影響到在你的 local repository 中的 `master` branch,他並不會將你的 `master` branch 更新到最新的狀態。",
|
||||||
"",
|
"",
|
||||||
|
@ -155,7 +155,7 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"要完成這一關,只要透過 `git fetch` 並且下載全部的 commit 即可!"
|
"要完成這一關,只要透過 `git fetch` 並且下載全部的 commit 即可!"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ exports.level = {
|
||||||
"hint": {
|
"hint": {
|
||||||
"en_US": "Pay attention how the commit ids may have swapped! You can read slides again with \"help level\"",
|
"en_US": "Pay attention how the commit ids may have swapped! You can read slides again with \"help level\"",
|
||||||
"zh_CN": "注意下提交对象的id是如何交换的! 你可以通过`help level`再次切到幻灯片!",
|
"zh_CN": "注意下提交对象的id是如何交换的! 你可以通过`help level`再次切到幻灯片!",
|
||||||
"zh_TW": "注意 commit 的 id 是怎麼被交換的! 你可以透過 `help level` 來閱讀對話視窗!",
|
"zh_TW": "注意 commit 的 id 是怎麼被交換的!你可以透過 `help level` 來閱讀對話視窗!",
|
||||||
"de_DE": "Beachte wie die Commit IDs getauscht wurden! Du kannst den Einführungsdialog mit \"help level\" erneut anzeigen"
|
"de_DE": "Beachte wie die Commit IDs getauscht wurden! Du kannst den Einführungsdialog mit \"help level\" erneut anzeigen"
|
||||||
},
|
},
|
||||||
"startDialog": {
|
"startDialog": {
|
||||||
|
@ -198,7 +198,7 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"\"在該例子當中,如果我特別透過 `<source>:<destination>` 來指定來源以及目的地,會發生什麼事情?\"",
|
"\"在該例子當中,如果我特別透過 `<source>:<destination>` 來指定 source 以及 destination,會發生什麼事情?\"",
|
||||||
"",
|
"",
|
||||||
"如果你很想要把 fetch 回來的 commit *直接*放到 local branch,那麼你就可以利用一個 colon refspec 來做到。你不能夠把 fetch 回來的 commit 放到你目前正 checkout 的 branch,如果不是的話,git 就會允許你這麼做。",
|
"如果你很想要把 fetch 回來的 commit *直接*放到 local branch,那麼你就可以利用一個 colon refspec 來做到。你不能夠把 fetch 回來的 commit 放到你目前正 checkout 的 branch,如果不是的話,git 就會允許你這麼做。",
|
||||||
"",
|
"",
|
||||||
|
@ -225,10 +225,10 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"如果我在執行這個指令之前,目的地不存在的話會怎樣?我們回到上一個例子,但這一次事前並沒有 `bar` 這個 branch 的存在。"
|
"如果我在執行這個指令之前,destination 不存在的話會怎樣?我們回到上一個例子,但這一次事前並沒有 `bar` 這個 branch 的存在。"
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"看到了吧,這就像是 `git push`,在 fetch 之前,git 會自己建立目的地,就好像是在 push 之前, git 會建立 remote 上的目的地一樣(如果它不存在的話)。"
|
"看到了吧,這就像是 `git push`,在 fetch 之前,git 會自己建立 destination,就好像是在 push 之前, git 會建立 remote 上的 destination 一樣(如果它不存在的話)。"
|
||||||
],
|
],
|
||||||
"command": "git fetch origin foo~1:bar",
|
"command": "git fetch origin foo~1:bar",
|
||||||
"beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2"
|
"beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2"
|
||||||
|
@ -255,7 +255,7 @@ exports.level = {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"好的,談了好多!要完成這一關,fetch 視覺化的目標所指定的 commit,好好玩這些指令吧!",
|
"好的,談了好多!要完成這一關,fetch 視覺化的目標所指定的 commit,好好玩這些指令吧!",
|
||||||
"",
|
"",
|
||||||
"對於兩個 fetch 的指令,你必須要指定來源以及目的地,注意一下視覺化的目標,因為 commit 的 id 可以被交換!"
|
"對於兩個 fetch 的指令,你必須要指定 source 以及 destination,注意一下視覺化的目標,因為 commit 的 id 可以被交換!"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,9 +166,9 @@ exports.level = {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"## Diverged Work",
|
"## Diverged Work",
|
||||||
"",
|
"",
|
||||||
"到目前為止我們已經知道如何 `pull` 其他人所送的 commit,而且也知道如何 `push` 我們自己的 commit,感覺很簡單,但是為什麼有人看起來很困惑?",
|
"到目前為止我們已經知道如何 `pull` 其他人所送的 commit,而且也知道如何 `push` 我們自己的 commit,感覺很簡單,但是為什麼有人看起來很困惑?",
|
||||||
"",
|
"",
|
||||||
"當 repo 的歷史紀錄是 *diverge (branch 走向不同)* 的狀態時就會很棘手,在討論這個之前,讓我們先來看一個例子...",
|
"當 repo 的歷史紀錄是 *diverge (branch 走向不同)* 的狀態時就會很棘手,在討論這個之前,讓我們先來看一個例子...",
|
||||||
""
|
""
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -177,11 +177,11 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"想像一下你在星期一的時候 clone 了一個 repo,並且開始在設計一個功能,在星期五的時候你準備好要發佈你的新功能,但是非常不幸地,你的同事已經寫了一連串的程式碼並且已經將 commit 發佈到 remote,所以現在*你的*進度是在一個比較*舊*的版本的後面 (如果與 remote 比較的話啦!)。",
|
"想像一下你在星期一的時候 clone 了一個 repo,並且開始在設計一個功能,在星期五的時候你準備好要發佈你的新功能,但是非常不幸地,你的同事已經寫了一連串的程式碼並且已經將 commit 發佈到 remote,所以現在*你的*進度是在一個比較*舊*的版本的後面(如果與 remote 比較的話啦!)。",
|
||||||
"",
|
"",
|
||||||
"在這種情況底下,使用 `git push` 會有問題,如果你使用 `git push`,那麼 git 應該要把 remote 退回到星期一的狀態? 它應該要把你所寫好的程式碼一起更新進去,同時不會影響你的同事寫好的程式碼? 或者是他應該要因為版本比較舊而完全忽略你的程式碼?",
|
"在這種情況底下,使用 `git push` 會有問題,如果你使用 `git push`,那麼 git 應該要把 remote 退回到星期一的狀態? 它應該要把你所寫好的程式碼一起更新進去,同時不會影響你的同事寫好的程式碼? 或者是他應該要因為版本比較舊而完全忽略你的程式碼?",
|
||||||
"",
|
"",
|
||||||
"因為在這種情況下會很麻煩 (當 git 歷史紀錄被 diverge 了 ), 所以 git 不會允許你 `push` 你的 commit。在你上傳你的 commit 之前,它實際上會先強迫你先跟 remote 同步。"
|
"因為在這種情況下會很麻煩(當 git 歷史紀錄被 diverge 了), 所以 git 不會允許你 `push` 你的 commit。在你上傳你的 commit 之前,它實際上會先強迫你先跟 remote 同步。"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -189,10 +189,10 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"講太多了啦! 讓我們實際看一下這個情況。"
|
"講太多了啦!讓我們實際看一下這個情況。"
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"看到了沒? 因為指令失敗了,所以沒有任何事情發生。 `git push` 失敗的原因是因為你最近的 commit `C3` 是在 `C1` 的後面,但是 remote 那邊是 `C2` 在 `C1` 的後面,所以 git 才會拒絕你的 push。"
|
"看到了沒?因為指令失敗了,所以沒有任何事情發生。 `git push` 失敗的原因是因為你最近的 commit `C3` 是在 `C1` 的後面,但是 remote 那邊是 `C2` 在 `C1` 的後面,所以 git 才會拒絕你的 push。"
|
||||||
],
|
],
|
||||||
"command": "git push",
|
"command": "git push",
|
||||||
"beforeCommand": "git clone; git fakeTeamwork; git commit"
|
"beforeCommand": "git clone; git fakeTeamwork; git commit"
|
||||||
|
@ -202,7 +202,7 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"你要如何解決這種情況? 很簡單,你只需要把 `C3` 接在 remote 最新的版本 `C2` 的後面就可以了。",
|
"你要如何解決這種情況?很簡單,你只需要把 `C3` 接在 remote 最新的版本 `C2` 的後面就可以了。",
|
||||||
"",
|
"",
|
||||||
"有一些方法可以做到,但是最直接的方式是用 rebase,我們來做看看。"
|
"有一些方法可以做到,但是最直接的方式是用 rebase,我們來做看看。"
|
||||||
]
|
]
|
||||||
|
@ -212,10 +212,10 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"在我們 push 之前,先來做 rebase‧‧‧"
|
"在我們 push 之前,先來做 rebase..."
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"看吧! 我們利用 `git fetch` 下載了 remote 上面的 commit,並且 rebase 我們的 commit 使得我們的 commit 可以接在 remote 上面最新的版本的後面,接著透過 `git push` 就可以上傳更新了。"
|
"看吧!我們利用 `git fetch` 下載了 remote 上面的 commit,並且 rebase 我們的 commit,使得我們的 commit 可以接在 remote 上面最新的版本的後面,接著透過 `git push` 就可以上傳更新了。"
|
||||||
],
|
],
|
||||||
"command": "git fetch; git rebase o/master; git push",
|
"command": "git fetch; git rebase o/master; git push",
|
||||||
"beforeCommand": "git clone; git fakeTeamwork; git commit"
|
"beforeCommand": "git clone; git fakeTeamwork; git commit"
|
||||||
|
@ -225,9 +225,9 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"在 remote 已經率先更新之後,還有沒有其它方法可以上傳我們的 commit? 當然有阿! 我們這次利用 `merge` 來做看看!",
|
"在 remote 已經率先更新之後,還有沒有其它方法可以上傳我們的 commit?當然有阿!我們這次利用 `merge` 來做看看!",
|
||||||
"",
|
"",
|
||||||
"雖然 `git merge` 並不會去移動你的 commit (反而會產生一個 merge commit),這是一個告訴 git 你已經下載了 remote 上面的 commit 並且在 local repo 中已經做完 merge,而因為 remote branch 上的最新的 commit 現在已經是 merge commit 的一個 *ancestor*,這就表示你的 commit 已經包含了在 remote branch 上的所有 commit。",
|
"雖然 `git merge` 並不會去移動你的 commit (反而會產生一個 merge commit),這是一個告訴 git 你已經下載了 remote 上面的 commit 並且在 local repo 中已經做完 merge,而因為 remote branch 上的最新的 commit 現在已經是 merge commit 的一個 *ancestor*,這就表示你的 commit 已經包含了在 remote branch 上的所有 commit。",
|
||||||
"",
|
"",
|
||||||
"讓我們來看一下這種情況..."
|
"讓我們來看一下這種情況..."
|
||||||
]
|
]
|
||||||
|
@ -240,7 +240,7 @@ exports.level = {
|
||||||
"現在假設我們不是用 rebase,而是用 merge..."
|
"現在假設我們不是用 rebase,而是用 merge..."
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"看吧!我們藉由 `git fetch` 把 remote 上的 commit 下載下來,並且 *merged* 該 commit 到我們目前的 branch (這樣就表示我們產生的 merge commit 有包含了 remote 上的 commit),接著再透過 `git push` 上傳到 remote。"
|
"看吧!我們藉由 `git fetch` 把 remote 上的 commit 下載下來,並且 *merged* 該 commit 到我們目前的 branch (這樣就表示我們產生的 merge commit 有包含了 remote 上的 commit),接著再透過 `git push` 上傳到 remote。"
|
||||||
],
|
],
|
||||||
"command": "git fetch; git merge o/master; git push",
|
"command": "git fetch; git merge o/master; git push",
|
||||||
"beforeCommand": "git clone; git fakeTeamwork; git commit"
|
"beforeCommand": "git clone; git fakeTeamwork; git commit"
|
||||||
|
@ -250,7 +250,7 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"太棒了! 有沒有其它可以不用打這麼多指令的方法?",
|
"太棒了! 有沒有其它可以不用打這麼多指令的方法?",
|
||||||
"",
|
"",
|
||||||
"當然有阿!你已經知道 `git pull` 就是表示一個 fetch 跟一個 merge。 有一個指令非常方便,那就是 `git pull --rebase`,它表示的是一個 fetch 以及一個 rebase。",
|
"當然有阿!你已經知道 `git pull` 就是表示一個 fetch 跟一個 merge。 有一個指令非常方便,那就是 `git pull --rebase`,它表示的是一個 fetch 以及一個 rebase。",
|
||||||
"",
|
"",
|
||||||
|
@ -265,7 +265,7 @@ exports.level = {
|
||||||
"首先 `--rebase`..."
|
"首先 `--rebase`..."
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"跟之前一樣!只是少了很多指令。"
|
"跟之前一樣!只是少打了很多指令。"
|
||||||
],
|
],
|
||||||
"command": "git pull --rebase; git push",
|
"command": "git pull --rebase; git push",
|
||||||
"beforeCommand": "git clone; git fakeTeamwork; git commit"
|
"beforeCommand": "git clone; git fakeTeamwork; git commit"
|
||||||
|
@ -278,7 +278,7 @@ exports.level = {
|
||||||
"現在用一般的 `pull`"
|
"現在用一般的 `pull`"
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"又來了,剛好跟之前的一樣!"
|
"又來了,剛好跟之前的一樣!"
|
||||||
],
|
],
|
||||||
"command": "git pull; git push",
|
"command": "git pull; git push",
|
||||||
"beforeCommand": "git clone; git fakeTeamwork; git commit"
|
"beforeCommand": "git clone; git fakeTeamwork; git commit"
|
||||||
|
|
|
@ -11,7 +11,7 @@ exports.level = {
|
||||||
"hint": {
|
"hint": {
|
||||||
"en_US": "Pay attention to the goal tree!",
|
"en_US": "Pay attention to the goal tree!",
|
||||||
"zh_CN": "注意目标树!",
|
"zh_CN": "注意目标树!",
|
||||||
"zh_TW": "注意最後要完成的目標!",
|
"zh_TW": "注意最後要完成的目標!",
|
||||||
"de_DE": "Beachte den Ziel-Baum!"
|
"de_DE": "Beachte den Ziel-Baum!"
|
||||||
},
|
},
|
||||||
"compareOnlyMaster": true,
|
"compareOnlyMaster": true,
|
||||||
|
@ -67,11 +67,11 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"## 為何不要 merge?",
|
"## 為何不要 merge?",
|
||||||
"",
|
"",
|
||||||
"為了要 push 新的 commit 給 remote,你只需要做的是先同步 remote 的更新,那就表示你可以使用 rebase *或者*是 merge remote branch (例如,`o/master`)。",
|
"為了要 push 新的 commit 給 remote,你只需要做的是先同步 remote 的更新,那就表示你可以使用 rebase *或者*是 merge remote branch (例如,`o/master`)。",
|
||||||
"",
|
"",
|
||||||
"所以假如你已經學會使用其中一個方式了,那為什麼我們到目前為止還在強調 `rebase`? 為什麼當提到 remote 的時候,反而 `merge` 比較沒有受到關注?",
|
"所以假如你已經學會使用其中一個方式了,那為什麼我們到目前為止還在強調 `rebase`?為什麼當提到 remote 的時候,反而 `merge` 比較沒有受到關注?",
|
||||||
""
|
""
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -82,17 +82,17 @@ exports.level = {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"在程式發展的社群中,關於 `merge` 以及 `rebase` 的孰優孰劣有很多的爭論。這裡我們會提到關於 `rebase` 的優點及缺點:",
|
"在程式發展的社群中,關於 `merge` 以及 `rebase` 的孰優孰劣有很多的爭論。這裡我們會提到關於 `rebase` 的優點及缺點:",
|
||||||
"",
|
"",
|
||||||
"優點:",
|
"優點:",
|
||||||
"",
|
"",
|
||||||
"* `rebase` 使得你的 commit tree 看起來更為簡潔,因為任何的 commit 都在一條直線上面。",
|
"* `rebase` 使得你的 commit tree 看起來更為簡潔,因為任何的 commit 都在一條直線上面。",
|
||||||
"",
|
"",
|
||||||
"缺點:",
|
"缺點:",
|
||||||
"",
|
"",
|
||||||
"* `rebase` 修改了 commit tree 的歷史紀錄。",
|
"* `rebase` 修改了 commit tree 的歷史紀錄。",
|
||||||
"",
|
"",
|
||||||
"舉例來說,我們可以 rebase commit `C1`,將 `C1` 接在*過去的* `C3` 上面,那麼就可以表現出 `C1` 是出現在 `C3` 的後面。",
|
"舉例來說,我們可以 rebase commit `C1`,將 `C1` 接在*過去的* `C3` 上面,那麼就可以表現出 `C1` 是出現在 `C3` 的後面。",
|
||||||
"",
|
"",
|
||||||
"有一些程式設計師喜歡保留歷史紀錄,因此他們會比較喜歡 `merge`; 其他人 (例如我自己) 比較喜歡一個簡潔的 commit tree,因此他們比較喜歡 `rebase`。這些都是擇你所愛。:D"
|
"有一些程式設計師喜歡保留歷史紀錄,因此他們會比較喜歡 `merge`; 其他人(例如我自己)比較喜歡一個簡潔的 commit tree,因此他們比較喜歡 `rebase`。這些都是擇你所愛。:D"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -82,16 +82,16 @@ exports.level = {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"## Git Pull",
|
"## Git Pull",
|
||||||
"",
|
"",
|
||||||
"現在我們已經知道如何利用 `git fetch` 從 remotre repository 抓取資料,讓我們來看一下如何更新我們的資料!",
|
"現在我們已經知道如何利用 `git fetch` 從 remote 抓取資料,讓我們來看一下如何更新我們的資料!",
|
||||||
"",
|
"",
|
||||||
"只要在你的 local repository 有新的 commit,便有很多方法可以做到這件事情,你可以把它們視為在其他 branch 上面的一般的 commit,這表示你可以執行像這樣子的命令:",
|
"只要在你的 local 有新的 commit,便有很多方法可以做到這件事情,你可以把它們視為在其它 branch 上面的一般的 commit,這表示你可以執行像這樣子的指令:",
|
||||||
"",
|
"",
|
||||||
"* `git cherry-pick o/master`",
|
"* `git cherry-pick o/master`",
|
||||||
"* `git rebase o/master`",
|
"* `git rebase o/master`",
|
||||||
"* `git merge o/master`",
|
"* `git merge o/master`",
|
||||||
"* 等等‧‧‧",
|
"* 等等‧‧‧",
|
||||||
"",
|
"",
|
||||||
"事實上,一次*下載 (fetch)* remote 的更新並且*合併 (merge)* 這些更新在 git 裡面是很常見的事情! 這個命令叫作 `git pull`。"
|
"事實上,一次*下載 (fetch)* remote 的更新並且*合併(merge)* 這些更新在 git 裡面是很常見的事情! 這個命令叫作 `git pull`。"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -102,7 +102,7 @@ exports.level = {
|
||||||
"讓我們來看循序執行一個 `fetch` 和一個 `merge` 的樣子"
|
"讓我們來看循序執行一個 `fetch` 和一個 `merge` 的樣子"
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"看吧! 我們利用 `fetch` 下載了 `C3` 並且利用 `git merge o/master` 來更新資料,現在我們的 `master` branch 跟 remote repository 的新的工作進度同步了 (在這個例子中,remote repository 叫作 `origin`)"
|
"看吧! 我們利用 `fetch` 下載了 `C3` 並且利用 `git merge o/master` 來更新資料,現在我們的 `master` branch 跟 remote 的新的工作進度同步了(在這個例子中,remote repository 叫作 `origin`)。"
|
||||||
],
|
],
|
||||||
"command": "git fetch; git merge o/master",
|
"command": "git fetch; git merge o/master",
|
||||||
"beforeCommand": "git clone; git commit; git fakeTeamwork"
|
"beforeCommand": "git clone; git commit; git fakeTeamwork"
|
||||||
|
@ -112,10 +112,10 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"如果用 `git pull` 會發生什麼事情?"
|
"如果用 `git pull` 會發生什麼事情?"
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"一樣! 很明顯地,`git pull` 其實就是 git fetch 跟 git merge 的循序執行的結果,而且 merge 的 branch 就是 fetch 所更新的 branch。"
|
"一樣!很明顯地,`git pull` 其實就是 git fetch 跟 git merge 的循序執行的結果,而且 merge 的 branch 就是 fetch 所更新的 branch。"
|
||||||
],
|
],
|
||||||
"command": "git pull",
|
"command": "git pull",
|
||||||
"beforeCommand": "git clone; git commit; git fakeTeamwork"
|
"beforeCommand": "git clone; git commit; git fakeTeamwork"
|
||||||
|
@ -125,7 +125,7 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"我們會解釋 `git pull` 的細節 (包括 options 以及 arguments), 但現在先讓我們在這個關卡試試看!",
|
"我們會解釋 `git pull` 的細節(包括可選擇的參數), 但現在先讓我們在這個關卡試試看!",
|
||||||
"",
|
"",
|
||||||
"記住喔,你可以利用循序執行的方式來執行 `fetch` 以及 `merge` 來完成這個關卡,但是相對於 `git pull`,你就得多打一個指令。:P"
|
"記住喔,你可以利用循序執行的方式來執行 `fetch` 以及 `merge` 來完成這個關卡,但是相對於 `git pull`,你就得多打一個指令。:P"
|
||||||
]
|
]
|
||||||
|
|
|
@ -121,7 +121,7 @@ exports.level = {
|
||||||
"",
|
"",
|
||||||
"`git fetch origin bar~1:bugFix; git merge bugFix`",
|
"`git fetch origin bar~1:bugFix; git merge bugFix`",
|
||||||
"",
|
"",
|
||||||
"看吧? `git pull` 真的就只是表示 fetch 跟 merge 的一個簡化後的指令,而且 `git pull` 所根據的是這些 commit 要放置的位置(在 fetch 的時候所指定的`目的地`)。",
|
"看吧? `git pull` 真的就只是表示 fetch 跟 merge 的一個簡化後的指令,而且 `git pull` 所根據的是這些 commit 要放置的位置(在 fetch 的時候所指定的`destination`)。",
|
||||||
"",
|
"",
|
||||||
"讓我們來看一個例子:"
|
"讓我們來看一個例子:"
|
||||||
]
|
]
|
||||||
|
@ -144,7 +144,7 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"他是不是也可以同時指定來源以及目的地?你說對了啦!讓我們來看一下:"
|
"他是不是也可以同時指定 source 以及 destination?你說對了啦!讓我們來看一下:"
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"哇!這個指令強而有力,我們在 local 建立了一個新的 `foo` branch,下載了 remote 的 `master` 的 commit,並且放到 local 的 `foo` branch,之後 merge `foo` branch 到我們目前所 checkout 的 `bar` branch。 這實在是在超過了!!!"
|
"哇!這個指令強而有力,我們在 local 建立了一個新的 `foo` branch,下載了 remote 的 `master` 的 commit,並且放到 local 的 `foo` branch,之後 merge `foo` branch 到我們目前所 checkout 的 `bar` branch。 這實在是在超過了!!!"
|
||||||
|
|
|
@ -11,7 +11,7 @@ exports.level = {
|
||||||
"hint": {
|
"hint": {
|
||||||
"en_US": "Remember you have to clone before you can push!",
|
"en_US": "Remember you have to clone before you can push!",
|
||||||
"zh_CN": "push之前你需要先克隆.",
|
"zh_CN": "push之前你需要先克隆.",
|
||||||
"zh_TW": "push 之前你需要先 clone.",
|
"zh_TW": "push 之前你需要先 clone",
|
||||||
"de_DE": "Denk dran, dass du einen Clone brauchst bevor du Pushen kannst!"
|
"de_DE": "Denk dran, dass du einen Clone brauchst bevor du Pushen kannst!"
|
||||||
},
|
},
|
||||||
"startDialog": {
|
"startDialog": {
|
||||||
|
@ -64,9 +64,9 @@ exports.level = {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"## Git Push",
|
"## Git Push",
|
||||||
"",
|
"",
|
||||||
"ok,現在我已經從 remote 那邊下載了一些更新,並且把它們 merge 到我的 local repository 上面的工作,這聽起來實在太讚了‧‧‧,但是我要如何分享_我_所做的更新給其它人呢?",
|
"ok,現在我已經從 remote 下載了一些更新,並且把它們 merge 到我的 local 上面的 branch,這聽起來實在太讚了...,但是我要如何分享_我_所做的更新給其它人呢?",
|
||||||
"",
|
"",
|
||||||
"喔,其實上傳並且分享更新跟下載更新並且 merge 是相反的兩件事情,那什麼是 `git pull` 的相反呢? 那就是 `git push`!",
|
"喔,其實上傳並且分享更新跟下載更新並且 merge 是相反的兩件事情,那什麼是 `git pull` 的相反呢? 那就是 `git push`!",
|
||||||
"",
|
"",
|
||||||
"`git push` 負責上傳_你的_ commit 到特定 remote 上面並且做出相對應的更新,只要做完了 `git push`,所有你的朋友都可以從 remote 上面下載你所送出去的 commit。",
|
"`git push` 負責上傳_你的_ commit 到特定 remote 上面並且做出相對應的更新,只要做完了 `git push`,所有你的朋友都可以從 remote 上面下載你所送出去的 commit。",
|
||||||
"",
|
"",
|
||||||
|
@ -78,10 +78,10 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"這裡我們有了一些 remote 所沒有的 commit。讓我們來上傳它們吧!"
|
"這裡我們有了一些 remote 所沒有的 commit。讓我們來上傳它們吧!"
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"我說的沒錯吧! remote 收到了 commit `C2`,同時在 remote 上的 `master` branch 也一起更新並且指向 `C2`,同時我們*自己的* `o/master` 也一併更新了!"
|
"我說的沒錯吧!remote 收到了 commit `C2`,同時在 remote 上的 `master` branch 也一起更新並且指向 `C2`,同時我們*自己的* `o/master` 也一併更新了!"
|
||||||
],
|
],
|
||||||
"command": "git push",
|
"command": "git push",
|
||||||
"beforeCommand": "git clone; git commit"
|
"beforeCommand": "git clone; git commit"
|
||||||
|
@ -91,7 +91,7 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"要完成這個關卡,只要上傳兩個新的 commit 給 remote,不要太得意忘形喔!因為這些課程將會愈來愈難!"
|
"要完成這個關卡,只要上傳兩個新的 commit 給 remote,不要太得意忘形喔!因為這些課程將會愈來愈難!"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,9 +97,9 @@ exports.level = {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"## Push 的參數",
|
"## Push 的參數",
|
||||||
"",
|
"",
|
||||||
"太好了! 現在你已經明白了 remote tracking,我們可以開始聊 git push,fetch,以及 pull 的一些有趣的地方,我們一次會講解一個 command,但是它們之間的概念是很類似的。",
|
"太好了!現在你已經明白了 remote tracking,我們可以開始聊 git push,fetch,以及 pull 的一些有趣的地方,我們一次會講解一個指令,但是它們之間的概念是很類似的。",
|
||||||
"",
|
"",
|
||||||
"首先我們來看一下 `git push`,你已經在 remote tracking 的課程中學習到 git 是根據目前 checkout 的 branch 所 track 的 remote branch 來做 push,這是在沒有任何的參數的情況下的預設動作,但是 git push 允許我們可以加上一些參數:",
|
"首先我們來看一下 `git push`,你已經在 remote tracking 的課程中學習到 git 是根據目前 checkout 的 branch 所 track 的 remote branch 來做 push,這是在沒有任何的參數的情況下的預設動作,但是 git push 允許我們可以加上一些參數:",
|
||||||
"",
|
"",
|
||||||
"`git push <remote> <place>`",
|
"`git push <remote> <place>`",
|
||||||
"",
|
"",
|
||||||
|
@ -121,7 +121,7 @@ exports.level = {
|
||||||
"",
|
"",
|
||||||
"將 `master` 當作 \"place\" 這個參數,我們告訴 git 這些 commit 是*從哪裡來的*,而且它們要*往哪裡去*。對於要同步兩個 repo, \"place\" 或者是 \"location\" 是非常重要的。",
|
"將 `master` 當作 \"place\" 這個參數,我們告訴 git 這些 commit 是*從哪裡來的*,而且它們要*往哪裡去*。對於要同步兩個 repo, \"place\" 或者是 \"location\" 是非常重要的。",
|
||||||
"",
|
"",
|
||||||
"要記住喔,因為我們告訴 git 它所要知道的 (有兩個參數),因此它才不會管你現在所 checkout 的 branch!"
|
"要記住喔,因為我們告訴 git 它所要知道的(有兩個參數),因此它才不會管你現在所 checkout 的 branch!"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -132,7 +132,7 @@ exports.level = {
|
||||||
"讓我們來看一個有加上參數的例子,在這個例子中,要特別注意到我們所 checkout 的位置。"
|
"讓我們來看一個有加上參數的例子,在這個例子中,要特別注意到我們所 checkout 的位置。"
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"我說的沒錯吧! 因為我們加上了參數,所以在 remote 上的 `master` branch 更新了"
|
"我說的沒錯吧!因為我們加上了參數,所以在 remote 上的 `master` branch 更新了"
|
||||||
],
|
],
|
||||||
"command": "git checkout C0; git push origin master",
|
"command": "git checkout C0; git push origin master",
|
||||||
"beforeCommand": "git clone; git commit"
|
"beforeCommand": "git clone; git commit"
|
||||||
|
@ -145,7 +145,7 @@ exports.level = {
|
||||||
"假如我們沒有特別指令參數會發生什麼事情?"
|
"假如我們沒有特別指令參數會發生什麼事情?"
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"指令會失敗 (就像你看到的),因為 `HEAD` 並沒有指向一個有 track remote branch 的 branch 上面阿。"
|
"指令會失敗(就像你看到的),因為 `HEAD` 並沒有指向一個有 track remote branch 的 branch 上面阿。"
|
||||||
],
|
],
|
||||||
"command": "git checkout C0; git push",
|
"command": "git checkout C0; git push",
|
||||||
"beforeCommand": "git clone; git commit"
|
"beforeCommand": "git clone; git commit"
|
||||||
|
@ -155,7 +155,7 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"好的,在這個關卡中,我們要更新在 remote 上的 `foo` 以及 `master` branch,比較遺憾的是 `git checkout` 在這個關卡中是不被允許的喔!"
|
"好的,在這個關卡中,我們要更新在 remote 上的 `foo` 以及 `master` branch,比較遺憾的是 `git checkout` 在這個關卡中是不被允許的喔!"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,13 +5,13 @@ exports.level = {
|
||||||
"name": {
|
"name": {
|
||||||
"en_US": "Git push arguments -- Expanded!",
|
"en_US": "Git push arguments -- Expanded!",
|
||||||
"zh_CN": "Git push 参数2!",
|
"zh_CN": "Git push 参数2!",
|
||||||
"zh_TW": "Git push 的參數 -- 延伸討論!",
|
"zh_TW": "Git push 的參數,延伸討論!",
|
||||||
"de_DE": "Optionen fü Git Push -- noch mehr!"
|
"de_DE": "Optionen fü Git Push -- noch mehr!"
|
||||||
},
|
},
|
||||||
"hint": {
|
"hint": {
|
||||||
"en_US": "Remember you can admit defeat and type in \"show solution\" :P",
|
"en_US": "Remember you can admit defeat and type in \"show solution\" :P",
|
||||||
"zh_CN": "如果你失败了, 可以通过 \"show solution\" 找到解决方案 :P",
|
"zh_CN": "如果你失败了, 可以通过 \"show solution\" 找到解决方案 :P",
|
||||||
"zh_TW": "如果你失敗了,可以利用 \"show solution\" 來找到解答 :P",
|
"zh_TW": "如果你失敗了,可以利用 \"show solution\" 來找到解答:P",
|
||||||
"de_DE": "Vergiss nicht dass du aufgeben kannst, indem du \"show solution\" eingibst :P"
|
"de_DE": "Vergiss nicht dass du aufgeben kannst, indem du \"show solution\" eingibst :P"
|
||||||
},
|
},
|
||||||
"startDialog": {
|
"startDialog": {
|
||||||
|
@ -93,11 +93,11 @@ exports.level = {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"## `<place>` 這個參數的細節",
|
"## `<place>` 這個參數的細節",
|
||||||
"",
|
"",
|
||||||
"回想一下,我們在之前的課程中提到,當我們用 `git push` 並且把 `master` 當作 place 這個參數的時候,我們就相當於告訴 git 我們的所要更新的 commit 要*從哪裡來*(來源) 並且要 *往哪裡去*(目的地)。",
|
"回想一下,我們在之前的課程中提到,當我們用 `git push` 並且把 `master` 當作 place 這個參數的時候,我們就相當於告訴 git 我們的所要更新的 commit 要*從哪裡來*(source) 並且要 *往哪裡去*(destination)。",
|
||||||
"",
|
"",
|
||||||
"你可能會很好奇,當我們的來源以及目的地是不同的時候,應該怎麼做? 當你想要 push `foo` branch 上面的 commit 到 remote 的 `bar` branch 的時候,應該怎麼做?",
|
"你可能會很好奇,當我們的 source 以及 destination 是不同的時候,應該怎麼做?當你想要 push `foo` branch 上面的 commit 到 remote 的 `bar` branch 的時候,應該怎麼做?",
|
||||||
"",
|
"",
|
||||||
"很遺憾地,對於 git 來說這是不可能的...開玩笑的啦! 當然是有可能的 :)... git 有非常非常大的彈性 (太超過了啦)。",
|
"很遺憾地,對於 git 來說這是不可能的...開玩笑的啦!當然是有可能的:)... git 有非常非常大的彈性(太超過了啦)。",
|
||||||
"",
|
"",
|
||||||
"讓我們來看看下一頁..."
|
"讓我們來看看下一頁..."
|
||||||
]
|
]
|
||||||
|
@ -107,13 +107,13 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"為了要指定 `<place>` 的來源以及目的地,只要利用一個分號將這兩個連在一起:",
|
"為了要指定 `<place>` 的 source 以及 destination,只要利用一個分號將這兩個連在一起:",
|
||||||
"",
|
"",
|
||||||
"`git push origin <source>:<destination>`",
|
"`git push origin <source>:<destination>`",
|
||||||
"",
|
"",
|
||||||
"這通常被稱為一個 colon (分號) refspec. refspec 只是一個表示 location (位置) 的花俏的名稱,這個位置可以被 git 識別 ( 例如 `foo` branch 或是 `HEAD~1`)。",
|
"這通常被稱為一個 colon (分號) refspec. refspec 只是一個表示 location (位置) 的花俏的名稱,這個位置可以被 git 辨別(例如 `foo` branch 或是 `HEAD~1`)。",
|
||||||
"",
|
"",
|
||||||
"一旦你單獨指定了來源以及目的地,你可以看到花俏且準確的指令。讓我來來看一個例子!"
|
"一旦你單獨指定了 source 以及 destination,你可以看到花俏且準確的指令。讓我來來看一個例子!"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -121,10 +121,10 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"記住, `來源` 表示任意可以被 git 辨識的 location:"
|
"記住, `source` 表示任意可以被 git 辨識的位置:"
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"哇!這實在是一個很花俏的指令但是確很合理 -- git 把 `foo^` 解讀成一個 location,並且 push 該 location 的 commit 到目前 remote 的 master branch。 "
|
"哇!這實在是一個很花俏的指令但是確很合理,git 把 `foo^` 解讀成一個位置,並且 push 該位置的 commit 到目前 remote 的 master branch。 "
|
||||||
],
|
],
|
||||||
"command": "git push origin foo^:master",
|
"command": "git push origin foo^:master",
|
||||||
"beforeCommand": "git clone; go -b foo; git commit; git commit"
|
"beforeCommand": "git clone; go -b foo; git commit; git commit"
|
||||||
|
@ -134,10 +134,10 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"如果你想要 push 的目的地 (destination) 不存在怎麼辦? 沒有問題! 只要給一個 branch 的名稱, git 就會在 remote 幫你建立。"
|
"如果你想要 push 的 destination 不存在怎麼辦?沒有問題!只要給一個 branch 的名稱,git 就會在 remote 幫你建立。"
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"太讚了,實在非常地簡單 :D"
|
"太讚了,實在非常地簡單:D"
|
||||||
],
|
],
|
||||||
"command": "git push origin master:newBranch",
|
"command": "git push origin master:newBranch",
|
||||||
"beforeCommand": "git clone; git commit"
|
"beforeCommand": "git clone; git commit"
|
||||||
|
@ -147,7 +147,7 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"對於這個關卡,想辦法達到這個視覺化的目標,而且要記得格式:",
|
"對於這個關卡,想辦法達到這個視覺化的目標,而且要記得格式:",
|
||||||
"",
|
"",
|
||||||
"`<來源>:<目的地>`"
|
"`<來源>:<目的地>`"
|
||||||
]
|
]
|
||||||
|
|
|
@ -79,13 +79,13 @@ exports.level = {
|
||||||
"",
|
"",
|
||||||
"現在你已經很熟悉 fetch,pull,以及 push,讓我們來針對一個新的問題來應用這些技巧。",
|
"現在你已經很熟悉 fetch,pull,以及 push,讓我們來針對一個新的問題來應用這些技巧。",
|
||||||
"",
|
"",
|
||||||
"在一個大型的專案裡面,程式設計師經常會在 feature branch (有別於 master branch) 上面做開發,之後等開發完之後,在一次 merge 回去。這跟之前的課程是很類似的 (其它的 branch 被 push 到 remote) 上,但是現在我們還要再多介紹一個步驟。",
|
"在一個大型的專案裡面,程式設計師經常會在 feature branch (有別於 master branch) 上面做開發,之後等開發完之後,在一次 merge 回去。這跟之前的課程是很類似的(其它的 branch 被 push 到 remote),但是現在我們還要再多介紹一個步驟。",
|
||||||
"",
|
"",
|
||||||
"某些程式設計師只針對 `master` branch 進行 push 或者是 pull。這樣子的話 `master` 一直都保持跟 remote (`o/master`) 同步。",
|
"某些程式設計師只針對 `master` branch 進行 push 或者是 pull。這樣子的話 `master` 一直都保持跟 remote (`o/master`) 同步。",
|
||||||
"",
|
"",
|
||||||
"所以針對這個問題我們結合了兩件事情:",
|
"所以針對這個問題我們結合了兩件事情:",
|
||||||
"",
|
"",
|
||||||
"* 將 feature branch 結合 (merge) 到`master` branch,並且",
|
"* merge feature branch 到`master` branch,並且",
|
||||||
"* push remote 以及 pull remote"
|
"* push remote 以及 pull remote"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -110,13 +110,13 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"這個關卡很複雜,這裡有一些提示:",
|
"這個關卡很複雜,這裡有一些提示:",
|
||||||
"",
|
"",
|
||||||
"* 總共有三個 feature branch,分別是 `side1`,`side2` 以及 `side3`",
|
"* 總共有三個 feature branch,分別是 `side1`,`side2` 以及 `side3`",
|
||||||
"* 我們想要將這三個 branch 分別 push 到 remote。",
|
"* 我們想要將這三個 branch 分別 push 到 remote。",
|
||||||
"* 但是 remote 已經被事先更新過了,所以我們必須要先同步那些更新。",
|
"* 但是 remote 已經被事先更新過了,所以我們必須要先同步那些更新。",
|
||||||
"",
|
"",
|
||||||
":O 很好! 祝你好運,完成這個關卡是一個很重要的步驟。"
|
":O 很好!祝你好運,完成這個關卡是一個很重要的步驟。"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,13 +5,13 @@ exports.level = {
|
||||||
"name": {
|
"name": {
|
||||||
"en_US": "Remote Branches",
|
"en_US": "Remote Branches",
|
||||||
"zh_CN": "Remote Branches",
|
"zh_CN": "Remote Branches",
|
||||||
"zh_TW": "Remote Branches (遠端分支)",
|
"zh_TW": "Remote Branches (遠端分支)",
|
||||||
"de_DE": "Branches auf entfernten Servern"
|
"de_DE": "Branches auf entfernten Servern"
|
||||||
},
|
},
|
||||||
"hint": {
|
"hint": {
|
||||||
"en_US": "Pay attention to the ordering -- commit on master first!",
|
"en_US": "Pay attention to the ordering -- commit on master first!",
|
||||||
"zh_CN": "Pay attention to the ordering -- commit on master first!",
|
"zh_CN": "Pay attention to the ordering -- commit on master first!",
|
||||||
"zh_TW": "注意順序的問題喔!先在 master branch 上面 commit",
|
"zh_TW": "注意順序的問題喔!先在 master branch 上面送 commit",
|
||||||
"de_DE": "Beachte die Sortierung -- committe zuerst auf dem master!"
|
"de_DE": "Beachte die Sortierung -- committe zuerst auf dem master!"
|
||||||
},
|
},
|
||||||
"startDialog": {
|
"startDialog": {
|
||||||
|
@ -86,11 +86,11 @@ exports.level = {
|
||||||
"",
|
"",
|
||||||
"現在你已經知道 `git clone` 在幹嘛了,讓我們仔細看看到底發生了什麼事。",
|
"現在你已經知道 `git clone` 在幹嘛了,讓我們仔細看看到底發生了什麼事。",
|
||||||
"",
|
"",
|
||||||
"你首先看到的是在你的本地端 (local repository) 出現了一個新的 branch 叫作 `o/master`,這種型態的 branch 叫作 remote branch (遠端分支),因為特殊的需求,因此 remote branch 有特殊的性質。",
|
"你首先看到的是在你的本地端(local repository)出現了一個新的 branch 叫作 `o/master`,這種型態的 branch 叫作 remote branch (遠端分支),因為特殊的需求,因此 remote branch 有特殊的性質。",
|
||||||
"",
|
"",
|
||||||
"remote branch 反應了 remote repository 的狀態 (因為你最後接觸的是這些 remote repository),最重要的是,在你想要分享你的工作給其他人時,你必須知道你現在的工作跟 remote repository 有哪些不同,而 remote branch 的狀態就是在告訴你這些資訊。",
|
"remote branch 反應了 remote repository 的狀態(因為你最後接觸的是這些 remote repository),最重要的是,在你想要分享你的工作給其他人時,你必須知道你現在的工作跟 remote repository 有哪些不同,而 remote branch 的狀態就是在告訴你這些資訊。",
|
||||||
"",
|
"",
|
||||||
"remote branch 有特別的特性,當你移動到 remote branch 時,你就進入到 detached `HEAD` 狀態,git 這樣做的原因是告訴你不能夠直接影響這些 branch。你必須要在其它的 branch 工作,並且分享到 remote。(分享之後,你的 remote branch 就會被更新)。"
|
"remote branch 有特別的特性,當你移動到 remote branch 時,你就進入到 detached `HEAD` 狀態,git 這樣做的原因是告訴你不能夠直接影響這些 branch。你必須要在其它的 branch 工作,並且分享到 remote (分享之後,你的 remote branch 就會被更新)。"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -100,7 +100,7 @@ exports.level = {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"### 什麼是 `o/`?",
|
"### 什麼是 `o/`?",
|
||||||
"",
|
"",
|
||||||
"你也許會對於 remote branch 前面的 `o/` 感到困惑,喔! remote branch 也 (需要) 一個命名法則,或者是一般表示 remote branch 的格式。",
|
"你也許會對於 remote branch 前面的 `o/` 感到困惑,喔!remote branch 也(需要) 一個命名法則,或者是一般表示 remote branch 的格式。",
|
||||||
"",
|
"",
|
||||||
"* `<remote 名稱>/<branch 名稱>`",
|
"* `<remote 名稱>/<branch 名稱>`",
|
||||||
"",
|
"",
|
||||||
|
@ -108,7 +108,7 @@ exports.level = {
|
||||||
"",
|
"",
|
||||||
"很多程式設計師實際上會把他們的 remote 命名為 `origin`,而不是 `o`,這在 git 是很常見的事情,因為當你使用 `git clone` 時,git 會自動把你的 remote 命名為 `origin`。",
|
"很多程式設計師實際上會把他們的 remote 命名為 `origin`,而不是 `o`,這在 git 是很常見的事情,因為當你使用 `git clone` 時,git 會自動把你的 remote 命名為 `origin`。",
|
||||||
"",
|
"",
|
||||||
"但是很不幸的是 `origin` 並沒有辦法完全顯示在我們的 UI 上面,所以我們用 `o` 來簡化它 (只要記住當你使用 git 的時候,實際上是命名為 `origin`)。",
|
"但是很不幸的是 `origin` 並沒有辦法完全顯示在我們的 UI 上面,所以我們用 `o` 來簡化它(只要記住當你使用 git 的時候,實際上是命名為 `origin`)。",
|
||||||
"",
|
"",
|
||||||
"有很多事情需要說明,現在讓我們來看看吧!"
|
"有很多事情需要說明,現在讓我們來看看吧!"
|
||||||
]
|
]
|
||||||
|
@ -118,7 +118,7 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"讓我們移動到 (check out) 一個 remote branch 並且看一下會發生什麼事情"
|
"讓我們移動到(checkout)一個 remote branch 並且看一下會發生什麼事情"
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"就像你看到的, git 讓我們進到 detached `HEAD` 狀態,同時,當我們加入一個新的 commit 時,`o/master` 都沒有更新,這是因為只有當 remote 更新的時候,`o/master` 才會更新。"
|
"就像你看到的, git 讓我們進到 detached `HEAD` 狀態,同時,當我們加入一個新的 commit 時,`o/master` 都沒有更新,這是因為只有當 remote 更新的時候,`o/master` 才會更新。"
|
||||||
|
|
|
@ -76,7 +76,7 @@ exports.level = {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"###`<source>` 奇怪的地方",
|
"###`<source>` 奇怪的地方",
|
||||||
"",
|
"",
|
||||||
"在兩個奇怪的情況下,git 不使用 `<source>` 參數,事實上,在`git push`以及`git fetch`的情況下,可以允許你\"不用\"指定`來源`,你可以藉由把參數留空,來表示你不想指定來源:",
|
"在兩個奇怪的情況下,git 不使用 `<source>` 參數,事實上,在`git push`以及`git fetch`的情況下,可以允許你\"不用\"指定` source`,你可以藉由把參數留空,來表示你不想指定 source:",
|
||||||
"",
|
"",
|
||||||
"* `git push origin :side`",
|
"* `git push origin :side`",
|
||||||
"* `git fetch origin :bugFix`",
|
"* `git fetch origin :bugFix`",
|
||||||
|
@ -89,10 +89,10 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"當*沒有*指定來源的時候,`push` 對於 remote branch 做了什麼?`push`把它刪除掉了!"
|
"當*沒有*指定 source 的時候,`push` 對於 remote branch 做了什麼?`push`把它刪除掉了!"
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"看吧,我們藉由把來源\"留空\",成功用 `push` 刪除了 `foo` branch,這合理吧..."
|
"看吧,我們藉由把 source \"留空\",成功用 `push` 刪除了 `foo` branch,這合理吧..."
|
||||||
],
|
],
|
||||||
"command": "git push origin :foo",
|
"command": "git push origin :foo",
|
||||||
"beforeCommand": "git clone; git push origin master:foo"
|
"beforeCommand": "git clone; git push origin master:foo"
|
||||||
|
@ -102,10 +102,10 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"最後,對於 `fetch` 來說,來源 \"留空\" 表示我們要在 local 上建立一個新的 branch。"
|
"最後,對於 `fetch` 來說,source \"留空\" 表示我們要在 local 上建立一個新的 branch。"
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"很奇怪,但那正是 git 為你做的事情!"
|
"很奇怪吧!但那正是 git 為你做的事情!"
|
||||||
],
|
],
|
||||||
"command": "git fetch origin :bar",
|
"command": "git fetch origin :bar",
|
||||||
"beforeCommand": "git clone"
|
"beforeCommand": "git clone"
|
||||||
|
|
|
@ -141,10 +141,10 @@ exports.level = {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"### Remote-Tracking branches",
|
"### Remote-Tracking branches",
|
||||||
"",
|
"",
|
||||||
"在之前的課程中,有一件事情看起來很\"神奇\",那就是 git 知道 `master` branch 是對應到 `o/master` branch。當然這些 branch 有類似的名稱,所以可以大概猜到, local 的 `master` branch 可以 connect 到 remote 的 `master branch`,但是我們是在兩種情況下可以確定有這個 connection:",
|
"在之前的課程中,有一件事情看起來很\"神奇\",那就是 git 知道 `master` branch 是對應到 `o/master` branch。當然這些 branch 有類似的名稱,所以可以大概猜到, local 的 `master` branch 可以對應到 remote 的 `master branch`,但是我們是在兩種情況下可以確定有這個對應關係:",
|
||||||
"",
|
"",
|
||||||
"* 在使用 `pull` 的時候,下載 commit 到 `o/master`,並且 `merge` 這些 commit 到 `master` branch,這就表示這個 merge 的目標是決定於這個 connection。",
|
"* 在使用 `pull` 的時候,下載 commit 到 `o/master`,並且 `merge` 這些 commit 到 `master` branch,這就表示這個 merge 的目標是決定於這個對應關係 。",
|
||||||
"* 在使用 `push` 的時候,在 `master` branch 上面的 commit 被 push 到 remote 上面的 `master` branch (它在 local 端被表示成 `o/master`),這就表示 push 的目標是決定於 `master` 以及 `o/master` 之間的 connection。",
|
"* 在使用 `push` 的時候,在 `master` branch 上面的 commit 被 push 到 remote 上面的 `master` branch (它在 local 被表示成 `o/master`),這就表示 push 的目標是決定於 `master` 以及 `o/master` 之間的對應關係。",
|
||||||
""
|
""
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -155,15 +155,15 @@ exports.level = {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"## Remote tracking",
|
"## Remote tracking",
|
||||||
"",
|
"",
|
||||||
"長話短說,我們可以用 branch 上面的 \"remote tracking\" 特性來表示介於 `master` 以及 `o/master` 的 connection,`master` branch 被設定用來追蹤 (track) `o/master`,這就表示對於 `master` branch 來說的話,有一個 merge 的目標以及 push 的目標。",
|
"長話短說,我們可以用 branch 上面的 \"remote tracking\" 特性來表示介於 `master` 以及 `o/master` 的 connection,`master` branch 被設定用來追蹤(track) `o/master`,這就表示對於 `master` branch 來說的話,有一個 merge 的目標以及 push 的目標。",
|
||||||
"",
|
"",
|
||||||
"你可能會覺得很奇怪,當你沒有下任何指令去設定的時候,關於 `master` branch 的 connection 是如何被設定的。喔,其實當你 clone 一個 repo 的時候,其實就已經自動幫你做設定了。 ",
|
"你可能會覺得很奇怪,當你沒有下任何指令去設定的時候,關於 `master` branch 的對應關係是如何被設定的。喔!其實當你 clone 一個 repo 的時候,其實就已經自動幫你做設定了。 ",
|
||||||
"",
|
"",
|
||||||
"在做 clone 的時候,git 會針對每一個在 remote 上面的 branch 建立一個 branch (例如 `o/master`),之後它會建立一個 local branch 來追蹤目前在 remote 上面的 active branch,在大部份的情況下,幾乎都是設定 `master` branch。",
|
"在做 clone 的時候,git 會針對每一個在 remote 上面的 branch 建立一個 branch (例如 `o/master`),之後它會建立一個 local branch 來追蹤目前在 remote 上面的 active branch,在大部份的情況下,幾乎都是設定 `master` branch。",
|
||||||
"",
|
"",
|
||||||
"一旦 git 完成這個動作,你就只會有一個 local branch ,但是你可以看到所有在 remote 上面的不同的 branch,對於 local 和 remote 來說的話,這樣子是最好的!",
|
"一旦 git 完成這個動作,你就只會有一個 local branch ,但是你可以看到所有在 remote 上面的不同的 branch,對於 local 和 remote 來說的話,這樣子是最好的!",
|
||||||
"",
|
"",
|
||||||
"這也解釋了為什麼當你 clone 的時候可能會看到以下被輸出的指令:",
|
"這也解釋了為什麼當你 clone 的時候可能會看到以下被輸出的指令:",
|
||||||
"",
|
"",
|
||||||
" local branch \"master\" set to track remote branch \"o/master\""
|
" local branch \"master\" set to track remote branch \"o/master\""
|
||||||
]
|
]
|
||||||
|
@ -173,15 +173,15 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"### 我可以自己設定嗎?",
|
"### 我可以自己設定嗎?",
|
||||||
"",
|
"",
|
||||||
"是的你可以! 你可以設定任何的 branch 來 track `o/master`, 假如你真的這麼做的話,那麼該 branch 的 push 及 merge 的目標就會跟 `master` 一樣。這就表示說你可以在 `totallyNotMaster` branch 上面執行 `git push`,並且 push 你的 commit 到 remote 的 `master` branch!",
|
"是的你可以!你可以設定任何的 branch 來 track `o/master`, 假如你真的這麼做的話,那麼該 branch 的 push 及 merge 的目標就會跟 `master` 一樣。這就表示說你可以在 `totallyNotMaster` branch 上面執行 `git push`,並且 push 你的 commit 到 remote 的 `master` branch!",
|
||||||
"",
|
"",
|
||||||
"有兩個方式可以設定,第一個就是藉由參考一個 remote branch 來 checkout 一個新的 branch。執行",
|
"有兩個方式可以設定,第一個就是藉由參考一個 remote branch 來 checkout 一個新的 branch。執行",
|
||||||
"",
|
"",
|
||||||
"`git checkout -b totallyNotMaster o/master`",
|
"`git checkout -b totallyNotMaster o/master`",
|
||||||
"",
|
"",
|
||||||
"建立一個新的 `totallyNotMaster` branch 並且它會 track `o/master`."
|
"建立一個新的 `totallyNotMaster` branch 並且它會 track `o/master`。"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -189,10 +189,10 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"說的好多,我們現在來看一個例子! 我們會 checkout 一個新的 `foo` branch,而且該 branch 會被用來 track remote 上的 `master` branch。"
|
"說的好多,我們現在來看一個例子!我們會 checkout 一個新的 `foo` branch,而且該 branch 會被用來 track remote 上的 `master` branch。"
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"就像你看到的,當 `o/master` 更新的時候,`foo` branch 也跟著一起被更新,要注意 master 並沒有被更新!"
|
"就像你看到的,當 `o/master` 更新的時候,`foo` branch 也跟著一起被更新,要注意 master 並沒有被更新!"
|
||||||
],
|
],
|
||||||
"command": "git checkout -b foo o/master; git pull",
|
"command": "git checkout -b foo o/master; git pull",
|
||||||
"beforeCommand": "git clone; git fakeTeamwork"
|
"beforeCommand": "git clone; git fakeTeamwork"
|
||||||
|
@ -221,7 +221,7 @@ exports.level = {
|
||||||
"",
|
"",
|
||||||
"`git branch -u o/master foo`",
|
"`git branch -u o/master foo`",
|
||||||
"",
|
"",
|
||||||
"你就會看到 `foo` branch 被設定成 track `o/master`,如果你現在已經 checkout 到 foo 這個 branch 上面了,你就可以省略掉它:",
|
"你就會看到 `foo` branch 被設定成 track `o/master`,如果你現在已經 checkout 到 foo 這個 branch 上面了,你就可以省略掉它:",
|
||||||
"",
|
"",
|
||||||
"`git branch -u o/master`",
|
"`git branch -u o/master`",
|
||||||
""
|
""
|
||||||
|
@ -235,7 +235,7 @@ exports.level = {
|
||||||
"我們來看這個快速設定 remote tracking 的方法..."
|
"我們來看這個快速設定 remote tracking 的方法..."
|
||||||
],
|
],
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"跟之前一樣,就只是一個更加明確的指令,讚啦!"
|
"跟之前一樣,就只是一個更加明確的指令,讚啦!"
|
||||||
],
|
],
|
||||||
"command": "git branch -u o/master foo; git commit; git push",
|
"command": "git branch -u o/master foo; git commit; git push",
|
||||||
"beforeCommand": "git clone; git checkout -b foo"
|
"beforeCommand": "git clone; git checkout -b foo"
|
||||||
|
@ -245,7 +245,7 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"好! 在這個關卡中,我們要 push 我們的 commit 到 remote 上面的 `master` branch,但是我們*不* checkout 到 local 的 `master` branch。因為這是一個進階的課程,所以我會讓你明白其它的東西。:P"
|
"好!在這個關卡中,我們要 push 我們的 commit 到 remote 上面的 `master` branch,但是我們*不* checkout 到 local 的 `master` branch。因為這是一個進階的課程,所以我會讓你明白其它的東西。:P"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue