Skip to content

Instantly share code, notes, and snippets.

@brianmay
Last active February 20, 2024 13:08
Show Gist options
  • Save brianmay/a84407351f9c9f0cb241 to your computer and use it in GitHub Desktop.
Save brianmay/a84407351f9c9f0cb241 to your computer and use it in GitHub Desktop.
learnGitBranching production/development lesson
{
"goalTreeString": "%7B%22branches%22%3A%7B%22master%22%3A%7B%22target%22%3A%22C3%27%22%2C%22id%22%3A%22master%22%2C%22remoteTrackingBranchID%22%3A%22o/master%22%7D%2C%22o/master%22%3A%7B%22target%22%3A%22C3%27%22%2C%22id%22%3A%22o/master%22%2C%22remoteTrackingBranchID%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%22C2%22%5D%2C%22id%22%3A%22C3%22%7D%2C%22C4%22%3A%7B%22parents%22%3A%5B%22C2%22%5D%2C%22id%22%3A%22C4%22%7D%2C%22C5%22%3A%7B%22parents%22%3A%5B%22C3%22%2C%22C4%22%5D%2C%22id%22%3A%22C5%22%7D%2C%22C6%22%3A%7B%22parents%22%3A%5B%22C4%22%5D%2C%22id%22%3A%22C6%22%7D%2C%22C7%22%3A%7B%22parents%22%3A%5B%22C5%22%2C%22C6%22%5D%2C%22id%22%3A%22C7%22%7D%2C%22C3%27%22%3A%7B%22parents%22%3A%5B%22C6%22%5D%2C%22id%22%3A%22C3%27%22%7D%7D%2C%22tags%22%3A%7B%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%22C3%27%22%2C%22id%22%3A%22master%22%2C%22remoteTrackingBranchID%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%22C4%22%3A%7B%22parents%22%3A%5B%22C2%22%5D%2C%22id%22%3A%22C4%22%7D%2C%22C6%22%3A%7B%22parents%22%3A%5B%22C4%22%5D%2C%22id%22%3A%22C6%22%7D%2C%22C3%27%22%3A%7B%22parents%22%3A%5B%22C6%22%5D%2C%22id%22%3A%22C3%27%22%7D%7D%2C%22tags%22%3A%7B%7D%2C%22HEAD%22%3A%7B%22target%22%3A%22master%22%2C%22id%22%3A%22HEAD%22%7D%7D%7D",
"solutionCommand": "git rebase o/master;git rebase -i o/master;git push",
"startTree": "{\"branches\":{\"master\":{\"target\":\"C7\",\"id\":\"master\",\"remoteTrackingBranchID\":\"o/master\"},\"o/master\":{\"target\":\"C6\",\"id\":\"o/master\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3\":{\"parents\":[\"C2\"],\"id\":\"C3\"},\"C4\":{\"parents\":[\"C2\"],\"id\":\"C4\"},\"C5\":{\"parents\":[\"C3\",\"C4\"],\"id\":\"C5\"},\"C6\":{\"parents\":[\"C4\"],\"id\":\"C6\"},\"C7\":{\"parents\":[\"C5\",\"C6\"],\"id\":\"C7\"}},\"tags\":{},\"HEAD\":{\"target\":\"master\",\"id\":\"HEAD\"},\"originTree\":{\"branches\":{\"master\":{\"target\":\"C6\",\"id\":\"master\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C4\":{\"parents\":[\"C2\"],\"id\":\"C4\"},\"C6\":{\"parents\":[\"C4\"],\"id\":\"C6\"}},\"tags\":{},\"HEAD\":{\"target\":\"master\",\"id\":\"HEAD\"}}}",
"hint": {
"en_US": "Try to make left tree a straight line, like the right."
},
"name": {
"en_US": "Production/Development Trees"
},
"startDialog": {
"en_US": {
"childViews": [
{
"type": "ModalAlert",
"options": {
"markdowns": [
"## Production vs Development",
"",
"We have a development git tree (remote/right), which we clone on to the production tree (local/left). We pull changes regularly when the remote changes."
]
}
},
{
"type": "GitDemonstrationView",
"options": {
"beforeMarkdowns": [
"# Changed Development tree",
"",
"We can make changes on the development tree, and can pull them onto the production tree."
],
"afterMarkdowns": [
"This works fine!"
],
"command": "git fakeTeamwork; git pull;\ngit fakeTeamwork; git pull;",
"beforeCommand": "git clone;\n"
}
},
{
"type": "GitDemonstrationView",
"options": {
"beforeMarkdowns": [
"## Changed production tree",
"",
"If we commit a change on the production tree, we encounter problems. Here make make commit C2 on the production tree, and pull change C3 from the development tree. We naively try to fix the mess by committing the same change, C2 to the development tree, which becomes C5."
],
"afterMarkdowns": [
"We end up having to merge all subsequent changes, even if we commit the same change on the development tree. We need to rebase to fix this."
],
"command": "git commit;\ngit fakeTeamwork; git pull;\ngit fakeTeamwork; git pull;",
"beforeCommand": "git clone;"
}
}
]
}
}
}
@1110sillabo
Copy link

Hi! I saw that gist through a link on https://github.com/pcottle/learnGitBranching, I think there's a typo here: "make make commit".

@brianmay
Copy link
Author

brianmay commented Apr 4, 2020

Hi! I saw that gist through a link on https://github.com/pcottle/learnGitBranching, I think there's a typo here: "make make commit".

@1110sillabo Where did you see this referenced? I don't even remember making this gist now.

@1110sillabo
Copy link

@brianmay Here in the readme under level builder... https://github.com/pcottle/learnGitBranching/blob/master/README.md (I'm so late to the gitgame). It took me a while to find out the gist for the level.

@brianmay
Copy link
Author

brianmay commented Apr 5, 2020

I created this for a bug report: pcottle/learnGitBranching#179. It was never intended that I would maintain it, or that anyone would use it (I suspect I copied it from on official example that is maintained).

@1110sillabo
Copy link

Thanks. I tried to create a pull request on the main repository but I did not find the example. I then looked on git searching part of the level text and ended up at your gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment