Final merge for Issue #165 PR #165

This commit is contained in:
hilojack 2014-03-03 15:45:27 +08:00 committed by Peter Cottle
parent c029a5876f
commit f0913d4e4c
16 changed files with 1197 additions and 7 deletions

View file

@ -4,10 +4,12 @@ exports.level = {
"startTree": "{\"branches\":{\"master\":{\"target\":\"C1\",\"id\":\"master\",\"remoteTrackingBranchID\":\"o/master\"},\"foo\":{\"target\":\"C1\",\"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\"}},\"HEAD\":{\"target\":\"C1\",\"id\":\"HEAD\"},\"originTree\":{\"branches\":{\"master\":{\"target\":\"C4\",\"id\":\"master\",\"remoteTrackingBranchID\":null},\"foo\":{\"target\":\"C6\",\"id\":\"foo\",\"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\":[\"C3\"],\"id\":\"C4\"},\"C5\":{\"parents\":[\"C1\"],\"id\":\"C5\"},\"C6\":{\"parents\":[\"C5\"],\"id\":\"C6\"}},\"HEAD\":{\"target\":\"foo\",\"id\":\"HEAD\"}}}",
"name": {
"en_US": "Fetch arguments",
"zh_CN": "Fetch arguments",
"de_DE": "Optionen für Fetch"
},
"hint": {
"en_US": "Pay attention how the commit ids may have swapped! You can read slides again with \"help level\"",
"zh_CN": "注意下提交对象的id是如何交换的! 你可以通过`help level`再次切到幻灯片!",
"de_DE": "Beachte wie die Commit IDs getauscht wurden! Du kannst den Einführungsdialog mit \"help level\" erneut anzeigen"
},
"startDialog": {
@ -134,6 +136,130 @@ exports.level = {
}
]
},
"zh_CN": {
"childViews": [
{
"type": "ModalAlert",
"options": {
"markdowns": [
"## Git fetch arguments",
"",
"我们刚学习了git push的参数, 特别是`<place>`参数, 更特别的冒号分隔(`<source>:<destination>`). 这写参数可以用于`git fetch`吗?",
"",
"你猜中了! git fetch的参数和git push相当相似. 都是相同的概念, 但是相反相反(因为现在你是下载 而非上传) ",
"",
"我们过一个概念.."
]
}
},
{
"type": "ModalAlert",
"options": {
"markdowns": [
"### `<place>` 参数",
"",
"你可以像如下命令这样为git fetch设置<place>",
"",
"`git fetch origin foo`",
"",
"Git 会来到远端的`foo`分支, 然后抓取所有不在本地的新提交, 放到本地的分支`o/foo`",
"",
"我们看看这个动作(这像是更新器) "
]
}
},
{
"type": "GitDemonstrationView",
"options": {
"beforeMarkdowns": [
"通过指定place..."
],
"afterMarkdowns": [
"我们只下载更新了o/foo"
],
"command": "git fetch origin foo",
"beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2"
}
},
{
"type": "ModalAlert",
"options": {
"markdowns": [
"你可以想知道 -- 为何git 会将新提交压入到o/foo 而不是 压入到我本地的foo. 我想 <place>参数就是同时存在于本地和远端 的 <place> ",
"",
"好吧, 本例中git 有个特殊例外, 因为你可能位于foo 分支, 你也不想弄乱它. 这得联系之前的课程 -- 它不会更新你的本地工作, 它只是下载提交(这样, 稍后你可以检查 或者 合并之). ",
""
]
}
},
{
"type": "ModalAlert",
"options": {
"markdowns": [
"\"Well in that case, what happens if I explicitly define both the source and destination with `<source>:<destination>`?\"",
"如果我们设定了 `<source>:<destination>`会发生什么呢?",
"",
"如果你觉得直接更新本地分支很爽, 那你就用冒号refspec吧. 不过, 你不能在检出的分支上干这个事.",
"",
"这里只有一个特点 -- `source` 是远端的位置, 而`<destination>`是要放置提交的本地位置, 这真是有趣 -- 这也是传送数据的对立方向! ",
"",
"话虽如此, 开发者很少这么做. 我已经介绍了, 概念上fetch/push很相似, 只是它们方向相反. "
]
}
},
{
"type": "GitDemonstrationView",
"options": {
"beforeMarkdowns": [
"我们看看更疯狂的例子:"
],
"afterMarkdowns": [
"哇! 看见了吧, git 将`foo~1` 解析成一个origin的位置, 然后下载到了本地`bar`. 注意foo 和 o/foo都没有得到更新 (因为我们指定了destination)."
],
"command": "git fetch origin foo~1:bar",
"beforeCommand": "git branch foo; git clone; git branch bar; git fakeTeamwork foo 2"
}
},
{
"type": "GitDemonstrationView",
"options": {
"beforeMarkdowns": [
"如果 destination 不存在呢? 我们看看上个幻灯片(不含bar)! "
],
"afterMarkdowns": [
"看见了吧, 它就像是git push. Git会自己确立本地destination, 就像是git在push时, 会自己确立destination(如果它不存在的话)"
],
"command": "git fetch origin foo~1",
"beforeCommand": "git branch foo; git clone; git fakeTeamwork foo 2"
}
},
{
"type": "GitDemonstrationView",
"options": {
"beforeMarkdowns": [
"没有参数呢?",
"",
"如果 `git fetch` 没有参数, 它会下载所有远端分支.."
],
"afterMarkdowns": [
"相当简单, 但是值得一次更新!"
],
"command": "git fetch",
"beforeCommand": "git branch foo; git clone; git fakeTeamwork foo; git fakeTeamwork master"
}
},
{
"type": "ModalAlert",
"options": {
"markdowns": [
"好, 说得太多了! 要完成本节, 抓取可视窗口指定的提交, 使用这些魔幻的命令吧.",
"",
"使用fetch时, 你必须指定source/destination. 注意一下可视窗口, 因为提交对象的id可以会被切换哦!"
]
}
}
]
},
"de_DE": {
"childViews": [
{