2016-11-19 98 views
1

我有一个关于分支和主分支在存储库中的问题。Bitbucket/Github存储库分支和主分支

如果我有两个不同的协作者同时在我的存储库上工作,其中一个正在主分支上工作,而另一个正在分支上工作,如果两个协作者都推动代码,会不会有冲突与此同时?

主分支的推送代码是否会覆盖另一个分支?

谢谢!

回答

1

以约冲突:

Suppose A and B are two collaborators; 
A working on master branch; 
B working on other branch; 

在这种情况下的冲突可能会如:

Despite of being at the different branch, 
A and B both are working on the same file like file.php 

以约覆盖

If you want to override one branch with another, You can use following command like: 
git merge 'branch_name' 

,将合并 'branch_name'支与你目前的工作分支。

+0

非常感谢你的启发! –

+0

不客气! –

1

不会有冲突,您的文章正是为什么使用分支机构!
只有当两个人试图同时在同一分支中提交同一文件时,才会发生冲突。