我刚合并了两个分支'branch1'和'branch2'。问题在于它现在已经混乱了很多冲突,有时候会有重复的内容(可能吗?)。按文件强制合并文件 - git
我想要做的是迫使'branch1'的某些文件与'branch2'合并,反过来强制一些来自'branch2'的文件合并到'branch1',知道我现在在' BRANCH1' 。可能吗 ?
更新:似乎有git-merge问题?假设我保持BRANCH1版本,然后
echo $this->fetch('prehome.html');
die;
会出现两次,请参阅:
protected function prehomepage()
{
$var = 'myvar';
echo $this->fetch('prehome.html');
die;
}
<<<<<<< HEAD
$this->mySmarty->assign('title', 'Primagora');
echo $this->fetch('prehome.html');
die;
}
/**
* Generate the campaign block for the general sidebar, called through AJAX.
*/
protected function getCampaignBlock()
{
$from = Utils::fromGet('from');
echo $this->getCampaignSidebarBlock($from);
die();
}
=======
/**
* Generate the campaign block for the general sidebar, called through AJAX.
*/
protected function getCampaignBlock()
{
$from = Utils::fromGet('from');
echo $this->getCampaignSidebarBlock($from);
die();
}
>>>>>>> branch2
我总是喜欢解决冲突而不是强制合并。虽然你可以检查[git-merge-file](http://git-scm.com/docs/git-merge-file) – Rikesh 2013-03-06 11:12:39
问题是git似乎犯了错误:例如我有两种方法分支,现在合并后它只出现在一个分支中,被捕获在一个===方法中>>> branch2 – Newben 2013-03-06 11:16:34
git永远不会删除你的代码 - 尽管你已经删除了该方法并在该分支中提交并且你已经合并了同样在其他分支。 – Rikesh 2013-03-06 11:18:50