mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-25 07:28:35 +02:00
sweet new level
This commit is contained in:
parent
e62a93452f
commit
016f0f45f1
3 changed files with 43 additions and 5 deletions
|
@ -1005,7 +1005,7 @@ GitEngine.prototype.push = function(options) {
|
|||
}, this);
|
||||
|
||||
chain = chain.then(_.bind(function() {
|
||||
var localLocationID = sourceLocation.get('target').get('id');
|
||||
var localLocationID = this.getCommitFromRef(sourceLocation).get('id');
|
||||
var remoteCommit = this.origin.refs[localLocationID];
|
||||
this.origin.setTargetLocation(branchOnRemote, remoteCommit);
|
||||
// unhighlight local
|
||||
|
|
|
@ -40,7 +40,8 @@ exports.levelSequences = {
|
|||
require('./remote/pushManyFeatures').level,
|
||||
require('./remote/mergeManyFeatures').level,
|
||||
require('./remote/tracking').level,
|
||||
require('./remote/pushArgs').level
|
||||
require('./remote/pushArgs').level,
|
||||
require('./remote/pushArgs2').level
|
||||
]
|
||||
};
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
exports.level = {
|
||||
"goalTreeString": "{\"branches\":{\"master\":{\"target\":\"C2\",\"id\":\"master\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"}},\"HEAD\":{\"target\":\"master\",\"id\":\"HEAD\"}}",
|
||||
"solutionCommand": "git commit ",
|
||||
"goalTreeString": "{\"branches\":{\"master\":{\"target\":\"C6\",\"id\":\"master\",\"remoteTrackingBranchID\":\"o/master\"},\"foo\":{\"target\":\"C4\",\"id\":\"foo\",\"remoteTrackingBranchID\":\"o/foo\"},\"o/master\":{\"target\":\"C4\",\"id\":\"o/master\",\"remoteTrackingBranchID\":null},\"o/foo\":{\"target\":\"C5\",\"id\":\"o/foo\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3\":{\"parents\":[\"C1\"],\"id\":\"C3\"},\"C4\":{\"parents\":[\"C2\",\"C3\"],\"id\":\"C4\"},\"C5\":{\"parents\":[\"C2\"],\"id\":\"C5\"},\"C6\":{\"parents\":[\"C5\"],\"id\":\"C6\"}},\"HEAD\":{\"target\":\"master\",\"id\":\"HEAD\"},\"originTree\":{\"branches\":{\"master\":{\"target\":\"C4\",\"id\":\"master\",\"remoteTrackingBranchID\":null},\"foo\":{\"target\":\"C5\",\"id\":\"foo\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C5\":{\"parents\":[\"C2\"],\"id\":\"C5\"},\"C3\":{\"parents\":[\"C1\"],\"id\":\"C3\"},\"C4\":{\"parents\":[\"C2\",\"C3\"],\"id\":\"C4\"}},\"HEAD\":{\"target\":\"master\",\"id\":\"HEAD\"}}}",
|
||||
"solutionCommand": "git push origin master^:foo;git push origin foo:master",
|
||||
"startTree": "{\"branches\":{\"master\":{\"target\":\"C6\",\"id\":\"master\",\"remoteTrackingBranchID\":\"o/master\"},\"foo\":{\"target\":\"C4\",\"id\":\"foo\",\"remoteTrackingBranchID\":\"o/foo\"},\"o/master\":{\"target\":\"C1\",\"id\":\"o/master\",\"remoteTrackingBranchID\":null},\"o/foo\":{\"target\":\"C1\",\"id\":\"o/foo\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"},\"C2\":{\"parents\":[\"C1\"],\"id\":\"C2\"},\"C3\":{\"parents\":[\"C1\"],\"id\":\"C3\"},\"C4\":{\"parents\":[\"C2\",\"C3\"],\"id\":\"C4\"},\"C5\":{\"parents\":[\"C2\"],\"id\":\"C5\"},\"C6\":{\"parents\":[\"C5\"],\"id\":\"C6\"}},\"HEAD\":{\"target\":\"master\",\"id\":\"HEAD\"},\"originTree\":{\"branches\":{\"master\":{\"target\":\"C1\",\"id\":\"master\",\"remoteTrackingBranchID\":null},\"foo\":{\"target\":\"C1\",\"id\":\"foo\",\"remoteTrackingBranchID\":null}},\"commits\":{\"C0\":{\"parents\":[],\"id\":\"C0\",\"rootCommit\":true},\"C1\":{\"parents\":[\"C0\"],\"id\":\"C1\"}},\"HEAD\":{\"target\":\"master\",\"id\":\"HEAD\"}}}",
|
||||
"name": {
|
||||
"en_US": "asd"
|
||||
},
|
||||
"hint": {
|
||||
"en_US": ""
|
||||
"en_US": "Remember you can admit defeat and type in \"see solution\" :P"
|
||||
},
|
||||
"startDialog": {
|
||||
"en_US": {
|
||||
|
@ -39,6 +40,42 @@ exports.level = {
|
|||
"Once you are specifying both the source and destination independently, you can get quite fancy and precise with remote commands. Let's see a demo!"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "GitDemonstrationView",
|
||||
"options": {
|
||||
"beforeMarkdowns": [
|
||||
"Remember, `source` is any location that git will understand:"
|
||||
],
|
||||
"afterMarkdowns": [
|
||||
"Woah! That's a pretty trippy command but it makes sense -- git resolved `foo^` into a location, uploaded whatever commits weren't present yet, and then updated destination."
|
||||
],
|
||||
"command": "git push origin foo^:master",
|
||||
"beforeCommand": "git clone; go -b foo; git commit; git commit"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "GitDemonstrationView",
|
||||
"options": {
|
||||
"beforeMarkdowns": [
|
||||
"What if the destination you want to push doesn't exist? No problem! Just give a branch name and git will create the branch on the remote for you"
|
||||
],
|
||||
"afterMarkdowns": [
|
||||
"Sweet, that's pretty slick :D"
|
||||
],
|
||||
"command": "git push origin master:newBranch",
|
||||
"beforeCommand": "git clone; git commit"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "ModalAlert",
|
||||
"options": {
|
||||
"markdowns": [
|
||||
"For this level, try to get to the end goal state shown in the visualization, and remember the format of:",
|
||||
"",
|
||||
"`<source>:<destination>`"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue