2014-02-17 36 views
0

我有以下分支:这是什么git日志 - 图表指示?

  • upgadingToJquery1.4

  • handlingExceptions

我工作的upgradingToJquery1.4分支和有做了几个提交。 我创建了另一个分支handlingExceptions作了一些更改并提交它们。 然后我切换回主并合并了handlingExceptions分支。令人惊讶的是我认为upgardeToJquery1.4分支的变化也得到了合并。然后确认我合并了upgradToJqueyry1.4分支,它表示最新。

有人可以解释图表显示的是什么吗?

git log --oneline --decorate --graph --all 
    * a54bd6d (HEAD, master) Merge branch 'upgradeToJquery1.4' 
    |\ 
    | * d4f762c (upgradeToJquery1.4) main.sass updated 
    * | bcf7a4f Merge branch 'handlingExceptions' 
    |\ \ 
    | * | 471c1ad (handlingExceptions) the postLogin method in the accountControlle catches the exceptions and now prov 
    | |/ 
    | * 76145d1 1. css/images - Jquerymobile icon files 
    | * 34bc7b9 custom-jqueryMobile.js - to override jquerymobile defaults.Currently added transitions dont work with p 
+0

这篇文章可能会帮助你http://stackoverflow.com/questions/20200226/how-to-understand-git-log-graph – user376507

回答

1

结构上,你有这样的(所有我在这里做的是重新绘制水平图表):

  D <-- upgradeToJquery1.4 
     / \ 
- A - B - C \ <-- handlingExceptions 
      \ \ 
------------- E - F <-- HEAD=master 

其中:

A = 34bc7b9 custom-jqueryMobile.js - to ... 
B = 76145d1 1. css/images - Jquerymobile icon files 
C = 471c1ad the postLogin method in ... 
D = d4f762c main.sass updated 
E = bcf7a4f Merge branch 'handlingExceptions' 
F = a54bd6d Merge branch 'upgradeToJquery1.4' 

有不同的方式来到这里,但因为你创建了handlingExceptions(推测与git checkout -b)最直接的可能是这样的:

git checkout upgradeToJquery1.4 
... make commit A (or maybe it was already there but you said make "a few" commits) 
... make commit B 
git checkout -b handlingExceptions 
... make commit C 
git checkout upgradeToJquery1.4 
... make commit D 
git checkout master 
git merge handlingExceptions 
git merge upgradeToJquery1.4 

另外,不同的方式来获得这里将是:

git checkout upgradeToJquery1.4 
... make commits A, B, and D 
git checkout HEAD^ # get back onto commit B 
git checkout -b handlingExceptions 
... make commit C 
... now checkout master and merge as before 

或代替单独git checkout HEAD^,你可以git checkout -b handlingExceptions HEAD^创建handlingExceptions,从而犯下了C作为B其父。

在任何情况下,虽然,在git merge handlingExceptions发生在这点,你就masterhandlingExceptions指出提交C,使创建提交E。提交消息和图形节点在此相互支持:E的父母是未显示的东西(第一父母)和C(第二父母)。然后,虽然仍在master上,单独git merge upgradeToJquery1.4创建承诺F,其父母是E(第一父母)和D(第二父母)。

无论如何,分支标签现在指向提交D,CF