2017-02-15 125 views
-1

我有兩個分支,主和分段。現在這兩個有相同的代碼版本。任何我對Staging進行了一些更改,並嘗試將其合併到master中,我收到了Conflict文件消息。我正在使用bitbucket兩個分支Git衝突

+2

[如何解決Git中的合併衝突?](http://stackoverflow.com/questions/161813/how-to-resolve-merge-conflicts-in-git) – 1615903

回答

1
You can use Github for ease 
remove conflict with symbols first 
======== or <<<<<<<<< 
then open git shell 
using command you can solve conflict coming during merge 
cmd is 
1 git status 
2 git add then press tab button or type path of conflict file 
3 again check git status 
4 now color of file change from red to green 
5 type cmd , git commit 
6 then git push 
now all set check using cmd git status 
+0

謝謝sunil爲你解答。那不是我所期望的。當更改Staging分支並嘗試合併該主分支時,則會在主分支中發生衝突。事情是我沒有改變主分支的任何東西。 –

+0

使用cmd檢查分支的git狀態是什麼 – sunil

0

我雲找到解決辦法我自己。發生了什麼事情,我用主文件替換了暫存分支,以便在分段分支中更改文件時,甚至在每次「文件已在兩側都進行了修改」的情況下,主分支git中沒有任何更改。因爲兩個分支指向相同的標題。爲了解決這個問題,我們需要重新分配每個分支。命令是git --rebase「origine/master」--force/git --rebase「origine/Staging」--force 之後,每個分支的頭指向彼此。