在git的2个不同分支中合并2个具有相同名称的文件 [英] Merging 2 files with the same name in 2 different branches in git
问题描述
我目前在从master
创建的名为branch1
的分支中有一个名为test1
的文件,在从master
创建的名为branch2
的分支中又有一个名为test1
的文件.
如果我将2个分支合并到master中,两个文件中写入的代码会怎样?
I currently have a file named test1
in a branch named branch1
created from master
and another file also named test1
in a branch named branch2
also created from master
.
What's gonna happen to the code written in both files if I merge the 2 branches in master?
推荐答案
步骤可能会做到:
-
将
branch1
合并到master
.
应该会顺利进行.
将master
合并到branch2
.
在这里您可能会遇到合并冲突.解决它.
Here you will probably get a merge conflict. Resolve it.
将branch2
合并到master
.
这将确保即使您犯了一些错误,您的母版也不会受到污染",分支上会出现错误,并且会得到解决.
This will make sure your master is never "poluted" even if you made some mistakes , there would be on branches, and would be resolved.
这篇关于在git的2个不同分支中合并2个具有相同名称的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!