mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-24 20:54:36 +02:00
better level filenames and slightly less silly names for better usage
This commit is contained in:
parent
f5484ac7e7
commit
b768f7a083
20 changed files with 297 additions and 297 deletions
91
src/levels/rampup/detachedHead.js
Normal file
91
src/levels/rampup/detachedHead.js
Normal 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.",
|
||||
"",
|
||||
"HEAD always points to the most recent commit which is reflected in the working tree. Most git commands which make changes to the working tree will start by changing HEAD.",
|
||||
"",
|
||||
"Normally HEAD points to a branch name (like bugFix). When you commit, the status of bugFix is altered and this change is visible through HEAD."
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"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 from `bugFix` and attach it to the commit instead.",
|
||||
"",
|
||||
"Specify this commit by its hash. The hash for each commit is displayed on the circle that represents the commit."
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue