为什么git无法合并? [英] Why is git not able to merge?
本文介绍了为什么git无法合并?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<<<<<<< HEAD
=======
if(($ mode =='w')){
$ mode ='r';
var_export($ GLOBALS,true);
//打印(< pre>);
// var_dump(array_keys($ GLOBALS));
// print(< / pre>);
}
>>>>>>> 7896670 ...我从其他目录进行的一些初始更改...
我只是想知道为什么git不能合并这两个提交?这是一个微不足道的合并,不是吗?一个版本包含 nothing ,另一个版本包含 ,所以合并很简单。我错过了什么?
解决方案
检查它们的共同祖先(合并基础) - 它应该包含别的东西 。
git diff`git merge-base HEAD 7896670` HEAD
When I try to rebase one of my branches onto another, git is not able to merge and raises conflict. I can see the following in the conflicted file:
<<<<<<< HEAD
=======
if (($mode == 'w')) {
$mode = 'r';
var_export($GLOBALS, true);
//print("<pre>");
//var_dump(array_keys($GLOBALS));
//print("</pre>");
}
>>>>>>> 7896670... Some initial changes that I carried over from other directory...
I am just wondering why git is not able to merge these two commits? It is a trivial merge, isn't it? One version contains nothing and another version contains something, so the merge is simple. What am I missing?
解决方案
Check the common ancestor of them (the merge base) -- it should contains something else.
git diff `git merge-base HEAD 7896670` HEAD
这篇关于为什么git无法合并?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文