mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-25 23:48:34 +02:00
232 lines
14 KiB
JavaScript
232 lines
14 KiB
JavaScript
exports.level = {
|
||
"goalTreeString": "%7B%22branches%22%3A%7B%22master%22%3A%7B%22target%22%3A%22C7%27%22%2C%22id%22%3A%22master%22%2C%22remoteTrackingBranchID%22%3A%22o/master%22%2C%22localBranchesThatTrackThis%22%3Anull%7D%2C%22o/master%22%3A%7B%22target%22%3A%22C7%27%22%2C%22id%22%3A%22o/master%22%2C%22remoteTrackingBranchID%22%3Anull%2C%22localBranchesThatTrackThis%22%3A%5B%22master%22%5D%7D%2C%22side1%22%3A%7B%22target%22%3A%22C2%27%22%2C%22id%22%3A%22side1%22%2C%22remoteTrackingBranchID%22%3Anull%2C%22localBranchesThatTrackThis%22%3Anull%7D%2C%22side2%22%3A%7B%22target%22%3A%22C4%27%22%2C%22id%22%3A%22side2%22%2C%22remoteTrackingBranchID%22%3Anull%2C%22localBranchesThatTrackThis%22%3Anull%7D%2C%22side3%22%3A%7B%22target%22%3A%22C7%27%22%2C%22id%22%3A%22side3%22%2C%22remoteTrackingBranchID%22%3Anull%2C%22localBranchesThatTrackThis%22%3Anull%7D%7D%2C%22commits%22%3A%7B%22C0%22%3A%7B%22parents%22%3A%5B%5D%2C%22id%22%3A%22C0%22%2C%22rootCommit%22%3Atrue%7D%2C%22C1%22%3A%7B%22parents%22%3A%5B%22C0%22%5D%2C%22id%22%3A%22C1%22%7D%2C%22C2%22%3A%7B%22parents%22%3A%5B%22C1%22%5D%2C%22id%22%3A%22C2%22%7D%2C%22C3%22%3A%7B%22parents%22%3A%5B%22C1%22%5D%2C%22id%22%3A%22C3%22%7D%2C%22C4%22%3A%7B%22parents%22%3A%5B%22C3%22%5D%2C%22id%22%3A%22C4%22%7D%2C%22C5%22%3A%7B%22parents%22%3A%5B%22C1%22%5D%2C%22id%22%3A%22C5%22%7D%2C%22C6%22%3A%7B%22parents%22%3A%5B%22C5%22%5D%2C%22id%22%3A%22C6%22%7D%2C%22C7%22%3A%7B%22parents%22%3A%5B%22C6%22%5D%2C%22id%22%3A%22C7%22%7D%2C%22C8%22%3A%7B%22parents%22%3A%5B%22C1%22%5D%2C%22id%22%3A%22C8%22%7D%2C%22C2%27%22%3A%7B%22parents%22%3A%5B%22C8%22%5D%2C%22id%22%3A%22C2%27%22%7D%2C%22C3%27%22%3A%7B%22parents%22%3A%5B%22C2%27%22%5D%2C%22id%22%3A%22C3%27%22%7D%2C%22C4%27%22%3A%7B%22parents%22%3A%5B%22C3%27%22%5D%2C%22id%22%3A%22C4%27%22%7D%2C%22C5%27%22%3A%7B%22parents%22%3A%5B%22C4%27%22%5D%2C%22id%22%3A%22C5%27%22%7D%2C%22C6%27%22%3A%7B%22parents%22%3A%5B%22C5%27%22%5D%2C%22id%22%3A%22C6%27%22%7D%2C%22C7%27%22%3A%7B%22parents%22%3A%5B%22C6%27%22%5D%2C%22id%22%3A%22C7%27%22%7D%7D%2C%22HEAD%22%3A%7B%22target%22%3A%22master%22%2C%22id%22%3A%22HEAD%22%7D%2C%22originTree%22%3A%7B%22branches%22%3A%7B%22master%22%3A%7B%22target%22%3A%22C7%27%22%2C%22id%22%3A%22master%22%2C%22remoteTrackingBranchID%22%3Anull%2C%22localBranchesThatTrackThis%22%3Anull%7D%7D%2C%22commits%22%3A%7B%22C0%22%3A%7B%22parents%22%3A%5B%5D%2C%22id%22%3A%22C0%22%2C%22rootCommit%22%3Atrue%7D%2C%22C1%22%3A%7B%22parents%22%3A%5B%22C0%22%5D%2C%22id%22%3A%22C1%22%7D%2C%22C8%22%3A%7B%22parents%22%3A%5B%22C1%22%5D%2C%22id%22%3A%22C8%22%7D%2C%22C2%27%22%3A%7B%22parents%22%3A%5B%22C8%22%5D%2C%22id%22%3A%22C2%27%22%7D%2C%22C3%27%22%3A%7B%22parents%22%3A%5B%22C2%27%22%5D%2C%22id%22%3A%22C3%27%22%7D%2C%22C4%27%22%3A%7B%22parents%22%3A%5B%22C3%27%22%5D%2C%22id%22%3A%22C4%27%22%7D%2C%22C5%27%22%3A%7B%22parents%22%3A%5B%22C4%27%22%5D%2C%22id%22%3A%22C5%27%22%7D%2C%22C6%27%22%3A%7B%22parents%22%3A%5B%22C5%27%22%5D%2C%22id%22%3A%22C6%27%22%7D%2C%22C7%27%22%3A%7B%22parents%22%3A%5B%22C6%27%22%5D%2C%22id%22%3A%22C7%27%22%7D%7D%2C%22HEAD%22%3A%7B%22target%22%3A%22master%22%2C%22id%22%3A%22HEAD%22%7D%7D%7D",
|
||
"solutionCommand": "git fetch;git rebase o/master side1;git rebase side1 side2;git rebase side2 side3;git rebase side3 master;git push",
|
||
"startTree": "{\"branches\":{\"master\":{\"target\":\"C1\",\"id\":\"master\",\"remoteTrackingBranchID\":\"o/master\",\"localBranchesThatTrackThis\":null},\"o/master\":{\"target\":\"C1\",\"id\":\"o/master\",\"remoteTrackingBranchID\":null,\"localBranchesThatTrackThis\":[\"master\"]},\"side1\":{\"target\":\"C2\",\"id\":\"side1\",\"remoteTrackingBranchID\":null,\"localBranchesThatTrackThis\":null},\"side2\":{\"target\":\"C4\",\"id\":\"side2\",\"remoteTrackingBranchID\":null,\"localBranchesThatTrackThis\":null},\"side3\":{\"target\":\"C7\",\"id\":\"side3\",\"remoteTrackingBranchID\":null,\"localBranchesThatTrackThis\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3\":{\"parents\":[\"C1\"],\"id\":\"C3\"},\"C4\":{\"parents\":[\"C3\"],\"id\":\"C4\"},\"C5\":{\"parents\":[\"C1\"],\"id\":\"C5\"},\"C6\":{\"parents\":[\"C5\"],\"id\":\"C6\"},\"C7\":{\"parents\":[\"C6\"],\"id\":\"C7\"}},\"HEAD\":{\"target\":\"side3\",\"id\":\"HEAD\"},\"originTree\":{\"branches\":{\"master\":{\"target\":\"C8\",\"id\":\"master\",\"remoteTrackingBranchID\":null,\"localBranchesThatTrackThis\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C8\":{\"parents\":[\"C1\"],\"id\":\"C8\"}},\"HEAD\":{\"target\":\"master\",\"id\":\"HEAD\"}}}",
|
||
"hint": {
|
||
"en_US": "Remember you can always use the undo or reset commands",
|
||
"zh_CN": "你随时都可以使用undo/reset命令.",
|
||
"zh_TW": "你隨時都可以使用 undo 或 reset 指令。",
|
||
"de_DE": "Denk dran, du kannst immer undo oder reset benutzen, um deine Befehle zurück zu nehmen."
|
||
},
|
||
"name": {
|
||
"en_US": "Push Master!",
|
||
"zh_CN": "Push Master!",
|
||
"zh_TW": "push master!",
|
||
"de_DE": "Push Master!"
|
||
},
|
||
"compareOnlyMasterHashAgnostic": true,
|
||
"startDialog": {
|
||
"en_US": {
|
||
"childViews": [
|
||
{
|
||
"type": "ModalAlert",
|
||
"options": {
|
||
"markdowns": [
|
||
"## Merging feature branches",
|
||
"",
|
||
"Now that you're comfortable with fetching, pulling, and pushing, lets put these skills to the test with a new workflow.",
|
||
"",
|
||
"It's common for developers on big projects to do all their work on feature branches (off of `master`) and then integrate that work only once it's ready. This is similar to the previous lesson (where side branches get pushed to the remote), but here we introduce one more step.",
|
||
"",
|
||
"Some developers only push and pull when on the `master` branch -- that way `master` always stays updated to what is on the remote (`o/master`).",
|
||
"",
|
||
"So for this workflow we combine two things:",
|
||
"",
|
||
"* integrating feature branch work onto `master`, and",
|
||
"* pushing and pulling from the remote"
|
||
]
|
||
}
|
||
},
|
||
{
|
||
"type": "GitDemonstrationView",
|
||
"options": {
|
||
"beforeMarkdowns": [
|
||
"Let's see a refresher real quick of how to update `master` and push work."
|
||
],
|
||
"afterMarkdowns": [
|
||
"We executed two commands here that:",
|
||
"",
|
||
"* rebased our work onto new commits from remote, and",
|
||
"* published our work to the remote"
|
||
],
|
||
"command": "git pull --rebase; git push",
|
||
"beforeCommand": "git clone; git commit; git fakeTeamwork"
|
||
}
|
||
},
|
||
{
|
||
"type": "ModalAlert",
|
||
"options": {
|
||
"markdowns": [
|
||
"This level is pretty hefty -- here is the general outline to solve:",
|
||
"",
|
||
"* There are three feature branches -- `side1` `side2` and `side3`",
|
||
"* We want to push each one of these features, in order, to the remote",
|
||
"* The remote has since been updated, so we will need to incorporate that work as well",
|
||
"",
|
||
":O intense! good luck, completing this level is a big step."
|
||
]
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"zh_TW": {
|
||
"childViews": [
|
||
{
|
||
"type": "ModalAlert",
|
||
"options": {
|
||
"markdowns": [
|
||
"## merge feature branch",
|
||
"",
|
||
"現在你已經很熟悉 fetch、pull 以及 push,讓我們來針對一個新的問題來應用這些技巧。",
|
||
"",
|
||
"在一個大型的專案裡面,程式設計師經常會在 feature branch(有別於 master branch) 上面做開發,之後等開發完之後,在一次 merge 回去。這跟之前的課程是很類似的(其它的 branch 被 push 到 remote),但是現在我們還要再多介紹一個步驟。",
|
||
"",
|
||
"某些程式設計師只針對 `master` branch 進行 push 或者是 pull。這樣子的話 `master` 一直都保持跟 remote (`o/master`) 同步。",
|
||
"",
|
||
"所以針對這個問題我們結合了兩件事情:",
|
||
"",
|
||
"* merge feature branch 到`master` branch,並且",
|
||
"* push remote 以及 pull remote"
|
||
]
|
||
}
|
||
},
|
||
{
|
||
"type": "GitDemonstrationView",
|
||
"options": {
|
||
"beforeMarkdowns": [
|
||
"讓我們馬上來實際看一下如何更新 `master` 並且 push 到 remote。"
|
||
],
|
||
"afterMarkdowns": [
|
||
"我們在這裡執行兩個指令:",
|
||
"",
|
||
"* rebase 我們的 branch 到 remote 的新的 commit 上面,並且",
|
||
"* 發佈到 remote 上面"
|
||
],
|
||
"command": "git pull --rebase; git push",
|
||
"beforeCommand": "git clone; git commit; git fakeTeamwork"
|
||
}
|
||
},
|
||
{
|
||
"type": "ModalAlert",
|
||
"options": {
|
||
"markdowns": [
|
||
"這個關卡很複雜,這裡有一些提示:",
|
||
"",
|
||
"* 總共有三個 feature branch,分別是 `side1`,`side2` 以及 `side3`",
|
||
"* 我們想要將這三個 branch 分別 push 到 remote。",
|
||
"* 但是 remote 已經被事先更新過了,所以我們必須要先同步那些更新。",
|
||
"",
|
||
":O 很好!祝你好運,完成這個關卡是一個很重要的步驟。"
|
||
]
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"de_DE": {
|
||
"childViews": [
|
||
{
|
||
"type": "ModalAlert",
|
||
"options": {
|
||
"markdowns": [
|
||
"## Einen Feature Branch reintegrieren",
|
||
"",
|
||
"Nun da du mit `fetch`, `pull`, und `push` vertraut bist sollten wir diese Fähigkeiten mit einem neuen Arbeitsablauf auf die Probe stellen.",
|
||
"",
|
||
"Für Entwickler in großen Projekten ist es nicht ungewöhnlich ihre Arbeit in Feature Branches (von `master` abgeleitet) zu erledigen und dann diese Inhalte zu reintegrieren, wenn sie fertig sind. Das ist ähnlich dem vorherigen Level (in dem ein Feature Branch auf den Server geschoben wird), nur mit einem zusätzlichen Schritt.",
|
||
"",
|
||
"Einige Entwickler pushen und pullen nur auf dem `master` -- dadurch ist `master` immer aktuell zu seinem Gegenstück auf dem Server (`o/master`).",
|
||
"",
|
||
"Für diesen Ablauf werden wir also zwei Dinge kombinieren:",
|
||
"",
|
||
"* einen Feature Bran in `master` reintegrieren und",
|
||
"* vom entfernten Server pushen und pullen."
|
||
]
|
||
}
|
||
},
|
||
{
|
||
"type": "GitDemonstrationView",
|
||
"options": {
|
||
"beforeMarkdowns": [
|
||
"Schauen wir uns zur Erinnerung schnell noch mal an wie man den `master` aktualisiert und seine Commits pusht."
|
||
],
|
||
"afterMarkdowns": [
|
||
"Wir haben hier zwei Befehle ausgeführt, die:",
|
||
"",
|
||
"* unsere Commits auf die neuen Commits vom Server gepackt und",
|
||
"* unsere Commits zum Server gepusht haben."
|
||
],
|
||
"command": "git pull --rebase; git push",
|
||
"beforeCommand": "git clone; git commit; git fakeTeamwork"
|
||
}
|
||
},
|
||
{
|
||
"type": "ModalAlert",
|
||
"options": {
|
||
"markdowns": [
|
||
"Dieser Level ist ziemlich heftig -- hier ist im Groben der Weg:",
|
||
"",
|
||
"* Es gibt drei Feature Branches -- `side1`, `side2` und `side3`.",
|
||
"* Wir möchten jedes dieser Features, in dieser Reihenfolge, auf den Server bringen.",
|
||
"* Der Server hat Commits, die wir noch nicht haben, diese müssen also bei uns integriert werden.",
|
||
"",
|
||
":O Krass! Viel Erfolg, diesen Level zu schaffen ist ein großer Schritt."
|
||
]
|
||
}
|
||
}
|
||
]
|
||
},
|
||
"zh_CN":{
|
||
"childViews": [
|
||
{
|
||
"type": "ModalAlert",
|
||
"options": {
|
||
"markdowns": [
|
||
"## 合并特性分支",
|
||
"",
|
||
"现在你应该很熟悉fetch/pull/push了, 现在我们将这些技能用于一种新的工作流.",
|
||
"",
|
||
"在一个大型项目中, 这是非常普遍的 -- 开发者在特性分支(不是`master`)上工作, 工作完成后只做一次合并. 这跟前面课程描述很相像, 不过本节我们会深入一些.",
|
||
"",
|
||
"一些开发者只在master上做push/pull —— 这样的话master总是最新的,即与远端(o/master)一致. ",
|
||
"",
|
||
"对于这样的工作流, 我们合并两个步骤",
|
||
"",
|
||
"* 合并特性分支到`master`",
|
||
"* 推送并更新远端"
|
||
]
|
||
}
|
||
},
|
||
{
|
||
"type": "GitDemonstrationView",
|
||
"options": {
|
||
"beforeMarkdowns": [
|
||
"让我们看看更快的推送流程 "
|
||
],
|
||
"afterMarkdowns": [
|
||
"我们执行了两个命令: ",
|
||
"",
|
||
"* 将远端的新提交衍合到我们的工作中",
|
||
"* 向远端推送我们的工作"
|
||
],
|
||
"command": "git pull --rebase; git push",
|
||
"beforeCommand": "git clone; git commit; git fakeTeamwork"
|
||
}
|
||
},
|
||
{
|
||
"type": "ModalAlert",
|
||
"options": {
|
||
"markdowns": [
|
||
"本篇有点儿复杂-- 以下是问题核心",
|
||
"",
|
||
"* 这里有三个特性分支 -- `side1` `side2` and `side3`",
|
||
"* 我需要按顺序将这三分支推送到远端.",
|
||
"* 因为远端已经被更新过了, 所以我们需要先做合并!",
|
||
"",
|
||
":O 紧张了? 祝好运! 完成了本节, 你就前进了一大步啦! "
|
||
]
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
};
|