mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-29 17:27:22 +02:00
update some translations
This commit is contained in:
parent
1a53e51610
commit
1d2c6a8d82
8 changed files with 124 additions and 70 deletions
|
@ -8,7 +8,7 @@ exports.level = {
|
||||||
"ko": "Git에서 브랜치 쓰기",
|
"ko": "Git에서 브랜치 쓰기",
|
||||||
"fr_FR": "Gérer les branches avec Git",
|
"fr_FR": "Gérer les branches avec Git",
|
||||||
"zh_CN": "建立Git分支",
|
"zh_CN": "建立Git分支",
|
||||||
"zh_TW": "建立 Git 分支"
|
"zh_TW": "建立 git branch"
|
||||||
},
|
},
|
||||||
"hint": {
|
"hint": {
|
||||||
"en_US": "Make a new branch with \"git branch [name]\" and check it out with \"git checkout [name]\"",
|
"en_US": "Make a new branch with \"git branch [name]\" and check it out with \"git checkout [name]\"",
|
||||||
|
@ -16,7 +16,7 @@ exports.level = {
|
||||||
"ja": "ブランチの作成(\"git branch [ブランチ名]\")と、チェックアウト(\"git checkout [ブランチ名]\")",
|
"ja": "ブランチの作成(\"git branch [ブランチ名]\")と、チェックアウト(\"git checkout [ブランチ名]\")",
|
||||||
"fr_FR": "Faites une nouvelle branche avec \"git branch [nom]\" positionnez-vous dans celle-ci avec \"git checkout [nom]\"",
|
"fr_FR": "Faites une nouvelle branche avec \"git branch [nom]\" positionnez-vous dans celle-ci avec \"git checkout [nom]\"",
|
||||||
"zh_CN": "用 'git branch [分支名]' 来创建分支,用 'git checkout [分支名]' 切换到分支",
|
"zh_CN": "用 'git branch [分支名]' 来创建分支,用 'git checkout [分支名]' 切换到分支",
|
||||||
"zh_TW": "用 'git branch [分支名稱]' 來建立分支,用 'git checkout [分支名稱]' 切換到該分支",
|
"zh_TW": "用 'git branch [ branch 名稱]' 來建立 branch,用 'git checkout [ branch 名稱]' 切換到該 branch",
|
||||||
"ko": "\"git branch [브랜치명]\"으로 새 브랜치를 만들고, \"git checkout [브랜치명]\"로 그 브랜치로 이동하세요"
|
"ko": "\"git branch [브랜치명]\"으로 새 브랜치를 만들고, \"git checkout [브랜치명]\"로 그 브랜치로 이동하세요"
|
||||||
},
|
},
|
||||||
"disabledMap": {
|
"disabledMap": {
|
||||||
|
@ -414,17 +414,17 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"## Git Branches",
|
"## git 的 branch",
|
||||||
"",
|
"",
|
||||||
" Git 的分支非常不占空間。它們只是一個指向某個 commit 的 reference —— 就這麼簡單。所以許多 Git 的愛好者會建議:",
|
" git 的 branch 非常不占空間。它們只是一個指向某個 commit 的 reference,就這麼簡單。所以許多 git 的愛好者會建議:",
|
||||||
"",
|
"",
|
||||||
"```",
|
"```",
|
||||||
"早點建立分支!經常建立分支!",
|
"早點建立 branch!經常建立 branch!",
|
||||||
"```",
|
"```",
|
||||||
"",
|
"",
|
||||||
"因為建立分支不怎麼會佔用到硬碟空間或者是記憶體,所以你可以把你目前的工作分成好幾個分支,這比只用一個分支要來的好。",
|
"因為建立 branch 不怎麼會佔用到硬碟空間或者是記憶體,所以你可以把你目前的工作分成好幾個 branch,這比只用一個 branch 要來的好。",
|
||||||
"",
|
"",
|
||||||
"同時使用分支和 commit 時,我們待會可以看到兩者如何配合。現在,只要記住使用分支其實就是在說:「我想要包含這一次的 commit 以及它的所有 parent commits。」"
|
"同時使用 branch 和 commit 時,我們待會可以看到兩者如何配合。現在,只要記住使用 branch 其實就是在說:「我想要包含這一次的 commit 以及它的所有 parent 的 commit。」"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -432,13 +432,13 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"舉一個例子來看看分支到底是什麼。",
|
"舉一個例子來看看 branch 到底是什麼。",
|
||||||
"",
|
"",
|
||||||
"這裡,我們建立一個名稱為 `newImage` 的新分支。"
|
"這裡,我們建立一個名稱為 `newImage` 的新的 branch。"
|
||||||
],
|
],
|
||||||
"command": "git branch newImage",
|
"command": "git branch newImage",
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"看,這就是建立分支所需的操作啦! `newImage` 分支現在指向提交記錄 `C1`。"
|
"看吧!這就是建立 branch 所需的操作啦! `newImage` branch 現在指向 commit `C1`。"
|
||||||
],
|
],
|
||||||
"beforeCommand": ""
|
"beforeCommand": ""
|
||||||
}
|
}
|
||||||
|
@ -447,11 +447,11 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"現在讓我們這個新分支做一些操作。點擊下面的按鈕。"
|
"現在讓我們這個新的 branch 做一些操作。點擊下面的按鈕。"
|
||||||
],
|
],
|
||||||
"command": "git commit",
|
"command": "git commit",
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"太奇怪了啦! `master` 分支前進了,但 `newImage` 分支沒有前進!這是因為我們沒有「在」這個新分支上,這也是為什麼星號(*)會在 `master` 上。"
|
"太奇怪了啦! `master` branch 前進了,但 `newImage` branch 沒有前進!這是因為我們沒有「在」這個新的 branch 上,這也是為什麼星號(*)會在 `master` 上。"
|
||||||
],
|
],
|
||||||
"beforeCommand": "git branch newImage"
|
"beforeCommand": "git branch newImage"
|
||||||
}
|
}
|
||||||
|
@ -460,17 +460,17 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"使用如下命令告訴 git 我們想要切換到新的分支",
|
"使用如下指令告訴 git 我們想要切換到新的 branch",
|
||||||
"",
|
"",
|
||||||
"```",
|
"```",
|
||||||
"git checkout [name]",
|
"git checkout [name]",
|
||||||
"```",
|
"```",
|
||||||
"",
|
"",
|
||||||
"這可以讓我們在 commit 之前切換到新的分支。"
|
"這可以讓我們在 commit 之前切換到新的 branch。"
|
||||||
],
|
],
|
||||||
"command": "git checkout newImage; git commit",
|
"command": "git checkout newImage; git commit",
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"太好了!新的分支已經記錄了我們的修改。"
|
"太好了!新的 branch 已經記錄了我們的修改。"
|
||||||
],
|
],
|
||||||
"beforeCommand": "git branch newImage"
|
"beforeCommand": "git branch newImage"
|
||||||
}
|
}
|
||||||
|
@ -479,8 +479,8 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"好啦,你已經準備好使用分支了。當目前的視窗關閉後,",
|
"好啦,你已經準備好使用 branch 了。當目前的視窗關閉後,",
|
||||||
"建立一個叫 `bugFix` 的新分支,然後切換過去。"
|
"建立一個叫 `bugFix` 的新的 branch,然後切換過去。"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ exports.level = {
|
||||||
"ja": "Gitのコミット",
|
"ja": "Gitのコミット",
|
||||||
'ko': 'Git 커밋 소개',
|
'ko': 'Git 커밋 소개',
|
||||||
'zh_CN': 'Git Commits简介',
|
'zh_CN': 'Git Commits简介',
|
||||||
'zh_TW': 'Git Commit 簡介'
|
'zh_TW': '介紹 git commit '
|
||||||
},
|
},
|
||||||
"goalTreeString": "{\"branches\":{\"master\":{\"target\":\"C3\",\"id\":\"master\"}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3\":{\"parents\":[\"C2\"],\"id\":\"C3\"}},\"HEAD\":{\"target\":\"master\",\"id\":\"HEAD\"}}",
|
"goalTreeString": "{\"branches\":{\"master\":{\"target\":\"C3\",\"id\":\"master\"}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3\":{\"parents\":[\"C2\"],\"id\":\"C3\"}},\"HEAD\":{\"target\":\"master\",\"id\":\"HEAD\"}}",
|
||||||
"solutionCommand": "git commit;git commit",
|
"solutionCommand": "git commit;git commit",
|
||||||
|
@ -294,12 +294,12 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"## Git Commits",
|
"## git commit",
|
||||||
"一個 commit 在 git repository 中會記錄目錄下所有文件的快照。感覺像是大量的複製和貼上,但 git 的速度更快!",
|
"一個 commit 在 git repo 中會記錄目錄下所有文件的快照。感覺像是大量的複製和貼上,但 git 的速度更快!",
|
||||||
"",
|
"",
|
||||||
"Git 希望 commit 儘可能地不占空間,所以每次進行 commit 的時候,它不會單純地複製整個目錄。實際上它把每次 commit 視為從目前的版本到下一個版本的變化量,或者說一個 \"(delta)\"。",
|
"git 希望 commit 儘可能地不占空間,所以每次進行 commit 的時候,它不會單純地複製整個目錄。實際上它把每次 commit 視為從目前的版本到下一個版本的變化量,或者說一個 \"(delta)\"。",
|
||||||
"",
|
"",
|
||||||
" Git 會保存 commit 的歷史紀錄,所以,絕大部分的 commit 的上面都會有 ancestor commits,在我們的圖形表示中,箭頭方向表示從 parent commit 到所對應的 child commit,保存這樣子的一個歷史紀錄是非常有用的。",
|
"git 會保存 commit 的歷史紀錄,所以,絕大部分的 commit 的上面都會有 parent commit,在我們的圖形表示中,箭頭方向表示從 parent commit 到所對應的 child commit,保存這樣子的一個歷史紀錄是非常有用的。",
|
||||||
"",
|
"",
|
||||||
"要學的東西有很多,但現在你可以把 commit 當作是當下的 project 的快照。commit 不占空間且可以快速切換!"
|
"要學的東西有很多,但現在你可以把 commit 當作是當下的 project 的快照。commit 不占空間且可以快速切換!"
|
||||||
]
|
]
|
||||||
|
@ -309,7 +309,7 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"在實例中學習 commit。右邊是一個(小)git repository。當前有兩個 commit —— initial commit `C0` 以及 `C1` 這一個 commit 來表示之後可能的一些修改。",
|
"在實例中學習 commit。右邊是一個(小)git repository。當前有兩個 commit,一開始的 commit `C0` 以及 `C1` 這一個 commit 來表示之後可能的一些修改。",
|
||||||
"",
|
"",
|
||||||
"點擊下面的按鈕生成新的 commit。"
|
"點擊下面的按鈕生成新的 commit。"
|
||||||
],
|
],
|
||||||
|
|
|
@ -8,7 +8,7 @@ exports.level = {
|
||||||
"ko": "Git에서 브랜치 합치기(Merge)",
|
"ko": "Git에서 브랜치 합치기(Merge)",
|
||||||
"ja": "ブランチとマージ",
|
"ja": "ブランチとマージ",
|
||||||
"zh_CN": "分支与合并",
|
"zh_CN": "分支与合并",
|
||||||
"zh_TW": "Git 中的 合併"
|
"zh_TW": "git 中的 merge"
|
||||||
},
|
},
|
||||||
"hint": {
|
"hint": {
|
||||||
"en_US": "Remember to commit in the order specified (bugFix before master)",
|
"en_US": "Remember to commit in the order specified (bugFix before master)",
|
||||||
|
@ -374,11 +374,11 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"## Branches and Merging",
|
"## branch 以及 merge",
|
||||||
"",
|
"",
|
||||||
"太好了! 我們已經知道怎麼使用 commit 和分支了。接下來要學的一招是如何合併兩個不同分支的工作。這讓我們可以建立一個新的分支,並且在上面開發新功能,然後合併回主分支。",
|
"太好了! 我們已經知道怎麼使用 commit 和 branch 了。接下來要學的一招是如何合併(merge)兩個不同 branch 的工作。這讓我們可以建立一個新的 branch ,並且在上面開發新功能,然後合併回 master branch。",
|
||||||
"",
|
"",
|
||||||
"`git merge` 是我們要學習合併的第一個方法。該合併會產生一個特殊的 commit,它包含兩個唯一 parent commit。一個 commit 如果有兩個 parent commit 的話,那就表示:「我想把這兩個 parent commit 本身及它們的 所有的 parent commit 都包含進來。」",
|
"`git merge` 是我們要學習 merge 的第一個方法。該 merge 會產生一個特殊的 commit,它包含兩個唯一 parent commit。一個 commit 如果有兩個 parent commit 的話,那就表示:「我想把這兩個 parent commit 本身及它們的 所有的 parent commit 都包含進來。」",
|
||||||
"",
|
"",
|
||||||
"有圖有真相,看看下面的圖就明白了。"
|
"有圖有真相,看看下面的圖就明白了。"
|
||||||
]
|
]
|
||||||
|
@ -388,17 +388,17 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"在這裡,我們有兩個分支:各自都有一個唯一的 commit。這意味著沒有一個分支包含我們對文件的所有修改。讓我們合併這兩個分支來解決這個問題。",
|
"在這裡,我們有兩個 branch:各自都有一個唯一的 commit。這意味著沒有一個 branch 包含我們對文件的所有修改。讓我們 merge 這兩個 branch 來解決這個問題。",
|
||||||
"",
|
"",
|
||||||
"我們要把 `bugFix` 合併到 `master` "
|
"我們要 merge `bugFix` 到 `master` "
|
||||||
],
|
],
|
||||||
"command": "git merge bugFix",
|
"command": "git merge bugFix",
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"哇!看見了沒有?首先,`master` 現在指向一個 commit,這個 commit 有兩個 parent commit。假如從 `master` 開始沿著箭頭向上走,在到達起點的路上會經過所有的提交記錄。這說明了現在 `master` 紀錄了對文件的所有修改。",
|
"哇!看見了沒有?首先,`master` 現在指向一個 commit,這個 commit 有兩個 parent commit。假如從 `master` 開始沿著箭頭向上走,在到達起點的路上會經過所有的 commit。這說明了現在 `master` 紀錄了對文件的所有修改。",
|
||||||
"",
|
"",
|
||||||
"還有,看見各個 commit 的顏色變化了嗎?為了幫助學習,我混合了顏色。每個分支都有特定的顏色。每個 commit 的顏色都變成了含有此 commit 的所有分支的混合色。",
|
"還有,看見各個 commit 的顏色變化了嗎?為了幫助學習,我混合了顏色。每個 branch 都有特定的顏色。每個 commit 的顏色都變成了含有此 commit 的所有 branch 的混合色。",
|
||||||
"",
|
"",
|
||||||
"所以,`master` 分支的顏色被混入到所有的 commit,但 `bugFix` 沒有。接下來就改一下這裡吧。"
|
"所以,`master` branch 的顏色被混入到所有的 commit,但 `bugFix` 沒有。接下來就改一下這裡吧。"
|
||||||
],
|
],
|
||||||
"beforeCommand": "git checkout -b bugFix; git commit; git checkout master; git commit"
|
"beforeCommand": "git checkout -b bugFix; git commit; git checkout master; git commit"
|
||||||
}
|
}
|
||||||
|
@ -407,13 +407,13 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"讓我們把 `master` 分支合併到 `bugFix` 吧。"
|
"讓我們 merge `master` branch 到 `bugFix` 吧。"
|
||||||
],
|
],
|
||||||
"command": "git checkout bugFix; git merge master",
|
"command": "git checkout bugFix; git merge master",
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"因為 `bugFix` 分支只是 `master` 分支的 ancestor,git 什麼都不用做,只是簡單地把 `bugfix` 分支移動到 `master` 指向的 commit。",
|
"因為 `bugFix` branch只是 `master` branch 的 parent,git 什麼都不用做,只是簡單地把 `bugfix` branch 移動到 `master` 指向的 commit。",
|
||||||
"",
|
"",
|
||||||
"現在所有的 commit 的顏色都是一樣的啦,這表示每一個分支都包含了所有文件的修改!太厲害了啦!"
|
"現在所有的 commit 的顏色都是一樣的啦,這表示每一個 branch 都包含了所有文件的修改!太厲害了啦!"
|
||||||
],
|
],
|
||||||
"beforeCommand": "git checkout -b bugFix; git commit; git checkout master; git commit; git merge bugFix"
|
"beforeCommand": "git checkout -b bugFix; git commit; git checkout master; git commit; git merge bugFix"
|
||||||
}
|
}
|
||||||
|
@ -424,12 +424,12 @@ exports.level = {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"想完成這一關,執行以下的操作:",
|
"想完成這一關,執行以下的操作:",
|
||||||
"",
|
"",
|
||||||
"* 建立新的分支 `bugFix` ",
|
"* 建立新的 branch,叫做 `bugFix` ",
|
||||||
"* 用 `git checkout bugFix` 切換到 `bugFix` 分支",
|
"* 用 `git checkout bugFix` 切換到 `bugFix` branch",
|
||||||
"* commit 一次",
|
"* commit 一次",
|
||||||
"* 用 `git checkout` 切換回 `master` 分支 ",
|
"* 用 `git checkout` 切換回 `master` branch",
|
||||||
"* 再 commit 一次",
|
"* 再 commit 一次",
|
||||||
"* 用 `git merge` 將 `bugFix` 合併到 `master`",
|
"* 用 `git merge` 將 `bugFix` merge 到 `master`",
|
||||||
"",
|
"",
|
||||||
"*記住,你可以用 \"help level\" 指令來重新顯示這個對話框!*"
|
"*記住,你可以用 \"help level\" 指令來重新顯示這個對話框!*"
|
||||||
]
|
]
|
||||||
|
|
|
@ -8,7 +8,7 @@ exports.level = {
|
||||||
"fr_FR": "Introduction à rebase",
|
"fr_FR": "Introduction à rebase",
|
||||||
"ko": "리베이스(rebase)의 기본",
|
"ko": "리베이스(rebase)의 기본",
|
||||||
"zh_CN": "Rebase简介",
|
"zh_CN": "Rebase简介",
|
||||||
"zh_TW": "Rebase 簡介"
|
"zh_TW": "介紹 rebase"
|
||||||
},
|
},
|
||||||
"hint": {
|
"hint": {
|
||||||
"en_US": "Make sure you commit from bugFix first",
|
"en_US": "Make sure you commit from bugFix first",
|
||||||
|
@ -17,7 +17,7 @@ exports.level = {
|
||||||
"fr_FR": "Assurez-vous de bien faire votre en premier votre commit sur bugFix",
|
"fr_FR": "Assurez-vous de bien faire votre en premier votre commit sur bugFix",
|
||||||
"ko": "bugFix 브랜치에서 먼저 커밋하세요",
|
"ko": "bugFix 브랜치에서 먼저 커밋하세요",
|
||||||
"zh_CN": "确保你先在 bugFix 分支进行提交",
|
"zh_CN": "确保你先在 bugFix 分支进行提交",
|
||||||
"zh_TW": "你要先在 bugFix 分支進行 commit"
|
"zh_TW": "你要先在 bugFix branch 進行 commit"
|
||||||
},
|
},
|
||||||
"disabledMap": {
|
"disabledMap": {
|
||||||
"git revert": true
|
"git revert": true
|
||||||
|
@ -362,13 +362,13 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"## Git Rebase",
|
"## git rebase",
|
||||||
"",
|
"",
|
||||||
"*rebasing*是在合併分支的第二種方法。Rebasing 就是取出一系列的 commit,\"複製\"它們,然後把它們接在別的地方。",
|
"*rebasing* 是 merge branch 的第二種方法。rebasing 就是取出一連串的 commit,\"複製\"它們,然後把它們接在別的地方。",
|
||||||
"",
|
"",
|
||||||
"雖然聽起來難以理解,rebasing 的優點是可以建立更線性的 commit history。假如只允許使用 rebasing 的話,則我們的 repository 中的 commit log 或者是 commit history 會更加簡潔好看。",
|
"雖然聽起來難以理解,rebasing 的優點是可以建立更線性的 commit history。假如只允許使用 rebasing 的話,則我們的 repo 中的 commit log 或者是 commit history 會更加簡潔好看。",
|
||||||
"",
|
"",
|
||||||
"讓我們親身體會一下……"
|
"讓我們親身體會一下..."
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -376,19 +376,19 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"這裡,還是有兩個分支;注意目前我們所在的分支是 bugFix(看那顆星啦)",
|
"這裡,還是有兩個 branch;注意目前我們所在的 branch 是 bugFix(看那顆星啦)",
|
||||||
"",
|
"",
|
||||||
"我們想要把在 bugfix 所做的修改直接移到 master 分支上。使用 rebasing 的話,兩個分支看起來像是依序按順序進行修改,實際上它們的修改是平行進行的。",
|
"我們想要把在 bugfix 所做的修改直接移到 master branch上。使用 rebasing 的話,兩個 branch 看起來像是依序按順序進行修改,實際上它們的修改是平行進行的。",
|
||||||
"",
|
"",
|
||||||
"用 `git rebase` 實現此目標"
|
"用 `git rebase` 來實現吧"
|
||||||
],
|
],
|
||||||
"command": "git rebase master",
|
"command": "git rebase master",
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"很厲害吧!現在 bugFix 分支上的工作在 master 的最前端,同時我們也得到了一個更加線性的 commit sequence。",
|
"很厲害吧!現在 bugFix branch 上的工作在 master branch 的最前端,同時我們也得到了一個更加線性的 commit 順序。",
|
||||||
"",
|
"",
|
||||||
"注意,本來的 commit C3 沒有消失(在圖上面呈現陰影),而我們\"複製\" C3,將它的副本 C3' 接在 master 的後面。",
|
"注意,本來的 commit C3 沒有消失(在圖上面呈現陰影),而我們\"複製\" C3,將它的副本 C3' 接在 master branch 的後面。",
|
||||||
"",
|
"",
|
||||||
"現在唯一的問題是 master 分支還沒有更新……我們接下來就更新它吧"
|
"現在唯一的問題是 master branch 還沒有更新...我們接下來就更新它吧!"
|
||||||
],
|
],
|
||||||
"beforeCommand": "git commit; git checkout -b bugFix C1; git commit"
|
"beforeCommand": "git commit; git checkout -b bugFix C1; git commit"
|
||||||
}
|
}
|
||||||
|
@ -397,11 +397,11 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"現在,切換到 `master` 分支。接下來就把它 rebase 到 `bugFix` 上面吧……"
|
"現在,切換到 `master` branch。接下來就把它 rebase 到 `bugFix` 上面吧..."
|
||||||
],
|
],
|
||||||
"command": "git rebase bugFix",
|
"command": "git rebase bugFix",
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"完成!因為 `master` 是 `bugFix` 的 ancestor,所以 git 只是把 `master` 分支往前移動到 `bugFix` 上。"
|
"完成!因為 `master` branch 是 `bugFix` 的 parent,所以 git 只是把 `master` branch 往前移動到 `bugFix` 上。"
|
||||||
],
|
],
|
||||||
"beforeCommand": "git commit; git checkout -b bugFix C1; git commit; git rebase master; git checkout master"
|
"beforeCommand": "git commit; git checkout -b bugFix C1; git commit; git rebase master; git checkout master"
|
||||||
}
|
}
|
||||||
|
@ -412,10 +412,10 @@ exports.level = {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"想完成這一關,執行以下操作:",
|
"想完成這一關,執行以下操作:",
|
||||||
"",
|
"",
|
||||||
"* 建立 `bugFix` 分支",
|
"* 建立 `bugFix` branch",
|
||||||
"* commit 一次",
|
"* commit 一次",
|
||||||
"* 切換回 master 分支再 commit 一次",
|
"* 切換回 master branch 再 commit 一次",
|
||||||
"* 再次切換到 bugFix 分支,將 bugFix 分支 rebase 到 master 上",
|
"* 再次切換到 bugFix branch,接著 rebase bugFix 這個 branch 到 master branch 上",
|
||||||
"",
|
"",
|
||||||
"祝你好運啦!"
|
"祝你好運啦!"
|
||||||
]
|
]
|
||||||
|
|
|
@ -27,7 +27,7 @@ exports.level = {
|
||||||
"ja": "このレベルではインタラクティブモードのrebaseやcherry-pickがクリアのカギです",
|
"ja": "このレベルではインタラクティブモードのrebaseやcherry-pickがクリアのカギです",
|
||||||
"ko": "대화식 리베이스(rebase -i)나 or 체리픽(cherry-pick)을 사용하세요",
|
"ko": "대화식 리베이스(rebase -i)나 or 체리픽(cherry-pick)을 사용하세요",
|
||||||
"zh_CN": "记住,交互式 rebase 或者 cherry-pick 会很有帮助",
|
"zh_CN": "记住,交互式 rebase 或者 cherry-pick 会很有帮助",
|
||||||
"zh_TW": "記住,使用 interactive rebase 或者 cherry-pick 會很有幫助"
|
"zh_TW": "記住,使用互動式的 rebase 或者 cherry-pick 會很有幫助"
|
||||||
},
|
},
|
||||||
"startDialog": {
|
"startDialog": {
|
||||||
"en_US": {
|
"en_US": {
|
||||||
|
@ -196,13 +196,13 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"## Locally stacked commits",
|
"## 在 local 的堆疊的 commit",
|
||||||
"",
|
"",
|
||||||
"有一個經常發生的情況:我在追蹤一個有點棘手的 bug,但是它實在太難抓出來了,在不得已的情況下我加入了一些 debug statement,並且做了一些 commit。",
|
"有一個經常發生的情況:我在追蹤一個有點棘手的 bug,但是它實在太難抓出來了,在不得已的情況下我加入了一些 debug 的指令,並且做了一些 commit。",
|
||||||
"",
|
"",
|
||||||
"所有的這些 debug statement 都只在 `bugFix` 這個分支裡面。最後我終於找到這個 bug,並且 fix 掉它,接著撒花慶祝一下!",
|
"所有的這些 debug 的指令都只在 `bugFix` 這個 branch 裡面。最後我終於找到這個 bug,並且 fix 掉它,接著撒花慶祝一下!",
|
||||||
"",
|
"",
|
||||||
"現在唯一的問題就是要把我在 `bugFix` 分支裡面所做的修改合併回 `master` 分支。我可以簡單地透過 fast-forward 來合併 ,但這樣的話 `master` 分支就會包含這些含有 debug statement 的 commit 了。我相信一定有其它方法..."
|
"現在唯一的問題就是要把我在 `bugFix` branch 裡面所做的修改 merge 回 `master` branch。我可以簡單地透過 fast-forward 來 merge ,但這樣的話 `master` branch 就會包含這些含有 debug 指令的 commit 了。我相信一定有其它方法..."
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -223,7 +223,7 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"這一個關卡是比較後面的關卡,你可以隨意決定你要選擇使用哪個指令,但是 `bugFix` 所指向的那個commit 一定要可以被 `master` 包含到"
|
"這一個關卡是比較後面的關卡,你可以隨意決定你要選擇使用哪個指令,但是 `bugFix` 所指向的那個 commit 一定要可以被 `master` branch 包含到"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,7 +202,7 @@ exports.level = {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"## commit 的戲法",
|
"## commit 的戲法",
|
||||||
"",
|
"",
|
||||||
"下面這種情況也是經常出現的。例如你之前已經在 `newImage` 分支上做了一些 commit,然後又開了一個分支叫做 `caption` ,並且在上面做了一些相關的 commit ,因此它們看起來是一個接著一個的。",
|
"下面這種情況也是經常出現的。例如你之前已經在 `newImage` branch 上做了一些 commit,然後又開了一個 branch 叫做 `caption` ,並且在上面做了一些相關的 commit ,因此它們看起來是一個接著一個的。",
|
||||||
"",
|
"",
|
||||||
"有點棘手的就是有時候你又想在之前的 commit 裡面做一些修改。在這個例子裡面,我們要去稍微修改一下 `newImage` 所指向的 commit,儘管已經是之前的 commit 了 。"
|
"有點棘手的就是有時候你又想在之前的 commit 裡面做一些修改。在這個例子裡面,我們要去稍微修改一下 `newImage` 所指向的 commit,儘管已經是之前的 commit 了 。"
|
||||||
]
|
]
|
||||||
|
@ -227,7 +227,7 @@ exports.level = {
|
||||||
"type": "ModalAlert",
|
"type": "ModalAlert",
|
||||||
"options": {
|
"options": {
|
||||||
"markdowns": [
|
"markdowns": [
|
||||||
"啊!最後還要提醒你一下最後所產生的 commit tree —— 因為我們把 commit 移動了兩次,所以會分別產生一個 apostrophe(單引號) commit。還有一個 apostrophe commit 是因為我們修改 commit 而加進來的。"
|
"啊!最後還要提醒你一下最後所產生的 commit tree,因為我們把 commit 移動了兩次,所以會分別產生一個 apostrophe(單引號) commit。還有一個 apostrophe commit 是因為我們修改 commit 而加進來的。"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ exports.level = {
|
||||||
"ja": "masterのポインタを先に進めることを忘れずに!",
|
"ja": "masterのポインタを先に進めることを忘れずに!",
|
||||||
"ko": "master를 변경 완료한 커밋으로 이동(forward)시키는 것을 잊지 마세요!",
|
"ko": "master를 변경 완료한 커밋으로 이동(forward)시키는 것을 잊지 마세요!",
|
||||||
"zh_CN": "别忘记了将 master 快进到最新的更新上!",
|
"zh_CN": "别忘记了将 master 快进到最新的更新上!",
|
||||||
"zh_TW": "別忘記了將 master 推到最新的修改上面!"
|
"zh_TW": "別忘記了將 master 推到最新的 commit 上面!"
|
||||||
},
|
},
|
||||||
"startDialog": {
|
"startDialog": {
|
||||||
"en_US": {
|
"en_US": {
|
||||||
|
@ -213,7 +213,7 @@ exports.level = {
|
||||||
"",
|
"",
|
||||||
"如你在上一個關卡所看到的,我們使用 `rebase -i` 來重新排列那些 commit。只要把我們想要修改的 commit 移到最前面,我們就可以很容易地重新修改它,然後再把它們重新排成我們想要的順序。",
|
"如你在上一個關卡所看到的,我們使用 `rebase -i` 來重新排列那些 commit。只要把我們想要修改的 commit 移到最前面,我們就可以很容易地重新修改它,然後再把它們重新排成我們想要的順序。",
|
||||||
"",
|
"",
|
||||||
"但唯一的問題就是這樣做就要排很多次,有可能造成 rebase conflicts。下面就看看用另外一種方法 `git cherry-pick` 是怎麼做的吧!"
|
"但唯一的問題就是這樣做就要排很多次,有可能造成 rebase conflict。下面就看看用另外一種方法 `git cherry-pick` 是怎麼做的吧!"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -221,13 +221,13 @@ exports.level = {
|
||||||
"type": "GitDemonstrationView",
|
"type": "GitDemonstrationView",
|
||||||
"options": {
|
"options": {
|
||||||
"beforeMarkdowns": [
|
"beforeMarkdowns": [
|
||||||
"要記住喔! cherry-pick 可以從 commit tree 的任何地方拿一個 commit 來放在 HEAD 上(只要那個 commit 不是 HEAD 的 ancestor)。",
|
"要記住喔! cherry-pick 可以從 commit tree 的任何地方拿一個 commit 來放在 HEAD 上(只要那個 commit 不是 HEAD 的 parent)。",
|
||||||
"",
|
"",
|
||||||
"下面是一個簡單清楚的 demo:"
|
"下面是一個簡單清楚的 demo:"
|
||||||
],
|
],
|
||||||
"command": "git cherry-pick C2",
|
"command": "git cherry-pick C2",
|
||||||
"afterMarkdowns": [
|
"afterMarkdowns": [
|
||||||
"太棒了,我們繼續吧!"
|
"太棒了,我們繼續吧!"
|
||||||
],
|
],
|
||||||
"beforeCommand": "git checkout -b bugFix; git commit; git checkout master; git commit"
|
"beforeCommand": "git checkout -b bugFix; git commit; git checkout master; git commit"
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,11 +4,13 @@ exports.level = {
|
||||||
"startTree": "{\"branches\":{\"master\":{\"target\":\"C5\",\"id\":\"master\",\"remoteTrackingBranchID\":null},\"side\":{\"target\":\"C3\",\"id\":\"side\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3\":{\"parents\":[\"C2\"],\"id\":\"C3\"},\"C4\":{\"parents\":[\"C1\"],\"id\":\"C4\"},\"C5\":{\"parents\":[\"C2\",\"C4\"],\"id\":\"C5\"}},\"tags\":{},\"HEAD\":{\"target\":\"master\",\"id\":\"HEAD\"}}",
|
"startTree": "{\"branches\":{\"master\":{\"target\":\"C5\",\"id\":\"master\",\"remoteTrackingBranchID\":null},\"side\":{\"target\":\"C3\",\"id\":\"side\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3\":{\"parents\":[\"C2\"],\"id\":\"C3\"},\"C4\":{\"parents\":[\"C1\"],\"id\":\"C4\"},\"C5\":{\"parents\":[\"C2\",\"C4\"],\"id\":\"C5\"}},\"tags\":{},\"HEAD\":{\"target\":\"master\",\"id\":\"HEAD\"}}",
|
||||||
"name": {
|
"name": {
|
||||||
"en_US": "Git Tags",
|
"en_US": "Git Tags",
|
||||||
"de_DE": "Git Tags"
|
"de_DE": "Git Tags",
|
||||||
|
"zh_TW": "git tag"
|
||||||
},
|
},
|
||||||
"hint": {
|
"hint": {
|
||||||
"en_US": "you can either check out the commit directly or simply checkout the tag!",
|
"en_US": "you can either check out the commit directly or simply checkout the tag!",
|
||||||
"de_DE": "Du kannst den Checkout entweder direkt auf den Commit oder das Tag machen."
|
"de_DE": "Du kannst den Checkout entweder direkt auf den Commit oder das Tag machen.",
|
||||||
|
"zh_TW": "你可以直接 checkout 到 commit 上,或是簡單的 checkout 到 tag 上"
|
||||||
},
|
},
|
||||||
"startDialog": {
|
"startDialog": {
|
||||||
"en_US": {
|
"en_US": {
|
||||||
|
@ -63,6 +65,58 @@ exports.level = {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"zh_TW": {
|
||||||
|
"childViews": [
|
||||||
|
{
|
||||||
|
"type": "ModalAlert",
|
||||||
|
"options": {
|
||||||
|
"markdowns": [
|
||||||
|
"## git tag",
|
||||||
|
"",
|
||||||
|
"就像你之前學到的一樣,branch 很容易被移動,而且當有新的 commit 時,又會再移動,branch 經常指向不同的 commit,branch 很容易改變。",
|
||||||
|
"",
|
||||||
|
"你可能會有疑問,有沒有什麼方法可以*永遠*有一個指向 commit 的記號,例如,表示重大的軟體釋出,或者是修正很大的 bug,有沒有其它比 branch 更好的方法,可以永遠地指向這些 commit?",
|
||||||
|
""
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "ModalAlert",
|
||||||
|
"options": {
|
||||||
|
"markdowns": [
|
||||||
|
"你說對了!git tag 可以解決這個問題,它們可以永遠地指向某個特定的 commit,就像是表示一個\"里程碑\"一樣。",
|
||||||
|
"",
|
||||||
|
"更重要的是,當有新的 commit 時,它們也不會移動,你可以 \"checkout\" 到 tag 上面,並且在上面 commit,tag 的存在就像是一個在 commit tree 上的表示特定訊息的一個錨。",
|
||||||
|
"",
|
||||||
|
"讓我們來實際看一下 tag 長什麼樣子..."
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "GitDemonstrationView",
|
||||||
|
"options": {
|
||||||
|
"beforeMarkdowns": [
|
||||||
|
"讓我們試著建立一個 tag,指向 commit `C1`,表示這是我們第一個版本。"
|
||||||
|
],
|
||||||
|
"afterMarkdowns": [
|
||||||
|
"看吧!非常容易,我們命名這個 tag 叫做 `v1`,並且讓它指向 commit `C1`,如果你離開了該 commit,git 會根據 `HEAD` 所指向的位置才分辨。"
|
||||||
|
],
|
||||||
|
"command": "git tag v1 C1",
|
||||||
|
"beforeCommand": "git commit"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "ModalAlert",
|
||||||
|
"options": {
|
||||||
|
"markdowns": [
|
||||||
|
"在這個關卡中,建立一個如視覺化目標裡面的 tag,然後 checkout 到 `v1` 上面,要注意你會進到 detached `HEAD` 的狀態,這是因為你不能夠直接在 `v1` 上面做 commit。",
|
||||||
|
"",
|
||||||
|
"在下個關卡中我們會介紹更多 tag 的應用..."
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"de_DE": {
|
"de_DE": {
|
||||||
"childViews": [
|
"childViews": [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue