Bitbucket/Github 存储库分支和主分支
Bitbucket/Github Repository branch and master branch
我对存储库中的分支和主分支有疑问。
如果我有 2 个不同的协作者同时在我的存储库上工作,其中一个在 master 分支上工作,而另一个在分支本身上工作,如果两个协作者都推送同时打码?
主分支推送的代码会覆盖其他分支吗?
谢谢!
不会有冲突,你的post正是使用分支的原因!
唯一会发生冲突的情况是 2 个人试图同时在同一个分支中提交同一个文件。
考虑冲突:
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' 分支与您当前的工作分支合并。
我对存储库中的分支和主分支有疑问。
如果我有 2 个不同的协作者同时在我的存储库上工作,其中一个在 master 分支上工作,而另一个在分支本身上工作,如果两个协作者都推送同时打码?
主分支推送的代码会覆盖其他分支吗?
谢谢!
不会有冲突,你的post正是使用分支的原因!
唯一会发生冲突的情况是 2 个人试图同时在同一个分支中提交同一个文件。
考虑冲突:
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' 分支与您当前的工作分支合并。