我剛合併了兩個分支'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