git只合并一个父级而不是真正的合并提交

时间:2014-05-28 16:22:09

标签: git merge

重要信息:

编辑:第三次尝试后(我在.git目录中看到了MERGE_MODE文件并且它没有消失)它突然起作用了。我真的很想知道为什么这个过程会失败,但我想没人能告诉我......

我已将多个分支合并为一个分支。 第一次合并非常有效但第三次合并并没有真正起作用:

我想将B合并到A中,所以我做了:

git checkout A
git merge B

这给了我用gvimdiff解决的一些冲突:

git mergetool -t gvimdiff
git commit

但是没有git-prepared标准的merge-commit-message,而是一条空消息。 该提交只有一个父(在分支A上合并之前提交)。

那么这里出了什么问题?

git log --graph --oneline -5 A的输出(我删除了不重要的消息):

* 7aaff12 Merge branch B into A.
*   2be0d29 Merge branch C into A
|\
| *   93fe75a Merge conflicts
| |\
| | * ca77a1a <removed commit message>
| | * aeb6f64 <removed commit message>

git log --graph --oneline -5 B的输出(我删除了不重要的消息):

* 65a7625 <removed commit message>
* 93bdd81 <removed commit message>
* 4e6c063 <removed commit message>
* ab81b67 <removed commit message>
* 569bdf9 <removed commit message>

git show-branch A B C的输出(根据评论员的要求):

! [A] Merges A into C again. Keeps important changes.
 ! [B] <no relevant commit message>
  ! [C] Merge branch 'C_userDB' into C
---
-   [A] Merges A into C again. Keeps important changes.
+   [A^2^2] <no relevant commit message>
+   [A^2^2^] <no relevant commit message>
+   [A^2^2~2] <no relevant commit message>
+   [A^2^2~3] <no relevant commit message>
+   [A^2^] Merge branch B into A.
+   [A^2~2^2^2] <no relevant commit message>
+   [A^2~2^2^2^] <no relevant commit message>
+   [A^2~2^2^2~2] <no relevant commit message>
+   [A^2~2^2^2~3] <no relevant commit message>
+   [A^2~2^2^2~4] Merge Conflicts
+   [A^2~2^2^2~5] <no relevant commit message>
+   [A^2~2^2~2] <no relevant commit message>
+   [A^2~3^2] <no relevant commit message>
+   [A^2~4] <no relevant commit message>
+   [A^2~3^2^] <no relevant commit message>
+   [A^2~3^2~2] <no relevant commit message>
+   [A^2~3^2~3] <no relevant commit message>
+   [A^2~3^2~4] <no relevant commit message>
+   [A^2~6] <no relevant commit message>
+   [A^2~8^2] <no relevant commit message>
+   [A^2~8^2^] <no relevant commit message>
+   [A^2~8^2~2] <no relevant commit message>
+   [A^2~9] <no relevant commit message>
+   [A^2~10] <no relevant commit message>
+   [A^2~11] <no relevant commit message>
+   [A^2~12] <no relevant commit message>
+   [A^] <no relevant commit message>
+   [A~2] <no relevant commit message>
+   [A~3] <no relevant commit message>
+   [A~4] <no relevant commit message>
+   [A~5] <no relevant commit message>
+   [A~6] <no relevant commit message>
+   [A~7] <no relevant commit message>
+   [A~8^2] <no relevant commit message>
+   [A~9] <no relevant commit message>
+   [A~10] <no relevant commit message>
+   [A~11] <no relevant commit message>
+   [A~12] <no relevant commit message>
+   [A~8^2^] <no relevant commit message>
+   [A~8^2~2] <no relevant commit message>
+   [A~8^2~3] <no relevant commit message>
+   [A~8^2~4] <no relevant commit message>
+   [A~14] <no relevant commit message>
- - [C] Merge branch D into C
+ + [C^2] <no relevant commit message>
+ + [C^] Merge conflicts
+ + [C~2] <no relevant commit message>
+ + [C~3] <no relevant commit message>
+ + [C~4] <no relevant commit message>
 +  [B] <no relevant commit message>
 +  [B^] <no relevant commit message>
 +  [B~2] <no relevant commit message>
 +  [B~3] <no relevant commit message>
 +  [B~4] <no relevant commit message>
 +  [B~5] <no relevant commit message>
 +  [B~6] <no relevant commit message>
 +  [B~7] <no relevant commit message>
++  [B~8] <no relevant commit message>
++  [B~9] <no relevant commit message>
++  [B~10] <no relevant commit message>
++  [B~11] <no relevant commit message>
--  [B~12] Merge branch B into A <NOTE: This was to fast-forward this branch after earlier merge>
++  [B~12^2] <no relevant commit message>
++  [B~12^2^] <no relevant commit message>
++  [B~12^2~2] <no relevant commit message>
++  [B~12^2~3] <no relevant commit message>
++  [B~12^2~4] <no relevant commit message>
++  [B~12^2~5] <no relevant commit message>
--  [B~13] Merge branch 'A_controller' into A
--  [B~13^2] Merge branch 'A_controller_mk' into A_controller
++  [B~13^2^2] <no relevant commit message>
++  [B~13^2^] <no relevant commit message>
++  [B~13^2~2] <no relevant commit message>
++  [B~13^2~3] <no relevant commit message>
++  [B~13^2~4] <no relevant commit message>
++  [B~13^2~5] <no relevant commit message>
++  [B~14] <no relevant commit message>
--  [B~15] merge conflicts
--- [C~5] Merge branch 'A' into A_logger

0 个答案:

没有答案