2017-02-15 135 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 之后,每个分支的头指向彼此。