This commit is contained in:
tumh 2014-04-27 18:26:18 +08:00
parent b1eecd7a74
commit 4261560f4b

View file

@ -19,6 +19,71 @@ exports.level = {
},
"startDialog": {
"en_US": {
"childViews": [
{
"type": "ModalAlert",
"options": {
"markdowns": [
"## Git Interactive Rebase",
"",
"Git cherry-pick is great when you know which commits you want (_and_ you know their corresponding hashes) -- it's hard to beat the simplicity it provides.",
"",
"But what about the situation where you don't know what commits you want? Thankfully git has you covered there as well! We can use interactive rebasing for this -- it's the best way to review a series of commits you're about to rebase.",
"",
"Let's dive into the details..."
]
}
},
{
"type": "ModalAlert",
"options": {
"markdowns": [
"All interactive rebase means is using the `rebase` command with the `-i` option.",
"",
"If you include this option, git will open up a UI to show you which commits are about to be copied below the target of the rebase. It also shows their commit hashes and messages, which is great for getting a bearing on what's what.",
"",
"For \"real\" git, the UI window means opening up a file in a text editor like `vim`. For our purposes, I've built a small dialog window that behaves the same way."
]
}
},
{
"type": "ModalAlert",
"options": {
"markdowns": [
"When the interactive rebase dialog opens, you have the ability to do 3 things:",
"",
"* You can reorder commits simply by changing their order in the UI (in our window this means dragging and dropping with the mouse).",
"* You can choose to completely omit some commits. This is designated by `pick` -- toggling `pick` off means you want to drop the commit.",
"* Lastly, you can squash commits. Unfortunately our levels don't support this for a few logistical reasons, so I'll skip over the details of this. Long story short, though -- it allows you to combine commits.",
"",
"Great! Let's see an example."
]
}
},
{
"type": "GitDemonstrationView",
"options": {
"beforeMarkdowns": [
"When you hit the button, an interactive rebase window will appear. Reorder some commits around (or feel free to unpick some) and see the result!"
],
"afterMarkdowns": [
"Boom! Git copied down commits in the exact same way you specified through the UI"
],
"command": "git rebase -i HEAD~4 --aboveAll",
"beforeCommand": "git commit; git commit; git commit; git commit"
}
},
{
"type": "ModalAlert",
"options": {
"markdowns": [
"To finish this level, do an interactive rebase and achieve the order shown in the goal visualization. Remember you can always `undo` or `reset` to fix mistakes :D"
]
}
}
]
},
"zh_TW": {
"childViews": [
{
"type": "ModalAlert",
@ -56,7 +121,7 @@ exports.level = {
"* 你可以選擇完全忽略掉某些 commit可以用滑鼠按一下使它變暗就表示你要忽略掉該 commit。",
"* 最後, 你可以把 commit 合併在一起,但基於某些理由,在我們的關卡裡面並沒有這個功能。",
"",
"Great! Let's see an example."
"太棒了!讓我們來看一個例子!"
]
}
},