new level

This commit is contained in:
Peter Cottle 2013-03-09 18:29:12 -08:00
parent 7d54a4d928
commit fed2da64c0
9 changed files with 303 additions and 13 deletions

View file

@ -8,6 +8,7 @@ exports.levelSequences = {
require('../../levels/intro/4').level
],
rampup: [
require('../../levels/rampup/1').level,
require('../../levels/rampup/2').level
],
rebase: [

91
src/levels/rampup/1.js Normal file
View file

@ -0,0 +1,91 @@
exports.level = {
"goalTreeString": "{\"branches\":{\"master\":{\"target\":\"C2\",\"id\":\"master\"},\"bugFix\":{\"target\":\"C4\",\"id\":\"bugFix\"}},\"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\"}},\"HEAD\":{\"target\":\"C4\",\"id\":\"HEAD\"}}",
"solutionCommand": "git checkout C4",
"startTree": "{\"branches\":{\"master\":{\"target\":\"C2\",\"id\":\"master\"},\"bugFix\":{\"target\":\"C4\",\"id\":\"bugFix\"}},\"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\"}},\"HEAD\":{\"target\":\"master\",\"id\":\"HEAD\"}}",
"name": {
"en_US": "Detach yo' HEAD"
},
"hint": {
"en_US": "Use the label (hash) on the commit for help!"
},
"startDialog": {
"en_US": {
"childViews": [
{
"type": "ModalAlert",
"options": {
"markdowns": [
"## Moving around in Git",
"",
"Before we get to some of the more advanced features of Git, it's important to understand different ways to move through the commit tree that represents your project.",
"",
"Once you're comfortable moving around, your powers with other git commands will be amplified!",
"",
"",
"",
"",
""
]
}
},
{
"type": "ModalAlert",
"options": {
"markdowns": [
"## HEAD",
"",
"First we have to talk about \"HEAD.\" HEAD is the symbolic name for the currently checked out commit -- it's essentially what commit you're working on top of.",
"",
"The working directory will always match the current state of HEAD, so by moving HEAD, you actually change the contents of your directory.",
"",
"Normally HEAD points to a branch name (like `bugFix`). When you commit, both bugFix and HEAD move together"
]
}
},
{
"type": "GitDemonstrationView",
"options": {
"beforeMarkdowns": [
"Let's see this in action. Here we will reveal HEAD before and after a commit."
],
"afterMarkdowns": [
"See! HEAD was hiding underneath our `master` branch all along."
],
"command": "git checkout C1; git checkout master; git commit; git checkout C2",
"beforeCommand": ""
}
},
{
"type": "GitDemonstrationView",
"options": {
"beforeMarkdowns": [
"### Detaching HEAD",
"",
"Detaching HEAD just means attaching it to a commit instead of a branch. This is what it looks like beforehand:",
"",
"HEAD -> master -> C1",
""
],
"afterMarkdowns": [
"And now it's",
"",
"HEAD -> C1"
],
"command": "git checkout C1",
"beforeCommand": ""
}
},
{
"type": "ModalAlert",
"options": {
"markdowns": [
"To complete this level, let's detach HEAD to the commit that `bugFix` is pointing to.",
"",
"Specify this commit by its hash. The hash for each commit is displayed on the circle that represents the commit."
]
}
}
]
}
}
};