Skip to content

Instantly share code, notes, and snippets.

@pcottle
Created September 23, 2020 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pcottle/d9e6f4a49c905d9977245366ce03d50a to your computer and use it in GitHub Desktop.
Save pcottle/d9e6f4a49c905d9977245366ce03d50a to your computer and use it in GitHub Desktop.
{
"goalTreeString": "{\"branches\":{\"master\":{\"target\":\"C2\",\"id\":\"master\",\"remoteTrackingBranchID\":\"o/master\"},\"o/master\":{\"target\":\"C1\",\"id\":\"o/master\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"}},\"tags\":{},\"HEAD\":{\"target\":\"master\",\"id\":\"HEAD\"},\"originTree\":{\"branches\":{\"master\":{\"target\":\"C1\",\"id\":\"master\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"}},\"tags\":{},\"HEAD\":{\"target\":\"master\",\"id\":\"HEAD\"}}}",
"solutionCommand": "git branch -f master;git checkout master",
"startTree": "{\"branches\":{\"master\":{\"target\":\"C1\",\"id\":\"master\",\"remoteTrackingBranchID\":\"o/master\"},\"o/master\":{\"target\":\"C1\",\"id\":\"o/master\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"}},\"tags\":{},\"HEAD\":{\"target\":\"C2\",\"id\":\"HEAD\"},\"originTree\":{\"branches\":{\"master\":{\"target\":\"C1\",\"id\":\"master\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"}},\"tags\":{},\"HEAD\":{\"target\":\"master\",\"id\":\"HEAD\"}}}",
"hint": {
"en_US": "You should move the master branch",
"fr_FR": "Vous devriez déplacer la branche master"
},
"name": {
"en_US": "Fix a git checkout o/master",
"fr_FR": "Corriger un git checkout o/master"
},
"startDialog": {
"en_US": {
"childViews": [
{
"type": "ModalAlert",
"options": {
"markdowns": [
"Sometimes, you make a mistake and type `git checkout o/master` instead of `git checkout master`. In that case, you find yourself on a detached branch, because you cannot checkout a remote branch. Be careful then not to commit anything or your commit won't be on any branch!"
]
}
},
{
"type": "GitDemonstrationView",
"options": {
"beforeMarkdowns": [
"Let's see the mistake."
],
"afterMarkdowns": [
"Oh, no! we lost `master` on the way!"
],
"command": "git checkout o/master;git commit",
"beforeCommand": "git clone;"
}
},
{
"type": "ModalAlert",
"options": {
"markdowns": [
"In this level, go get the `master` branch, but without a `checkout`, or else the commit on which you currently are will be unreachable.",
"",
"Hint: you can move a branch around with `git branch -f <branch> <destination>`."
]
}
}
]
},
"fr_FR": {
"childViews": [
{
"type": "ModalAlert",
"options": {
"markdowns": [
"Parfois, sans le faire exprès, il arrive qu'on tape `git checkout o/master` au lieu de `git checkout master`. Dans ce cas, on se retrouve sur une branche détachée. Attention alors, si vous faites un commit dans cet état! Il ne sera lié à aucune branche."
]
}
},
{
"type": "GitDemonstrationView",
"options": {
"beforeMarkdowns": [
"Voyons l'erreur commise:"
],
"afterMarkdowns": [
"Oh, non! Nous avons perdu `master` en chemin."
],
"command": "git checkout o/master;git commit",
"beforeCommand": "git clone;"
}
},
{
"type": "ModalAlert",
"options": {
"markdowns": [
"Pour ce niveau, aller rechercher la branche `master` sans faire de `checkout`, sinon la branche sur laquelle vous vous trouvez n'existera plus.",
"",
"Indice: on peut déplacer une branche avec `git branch -f <branche> <destination>`."
]
}
}
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment