![](/img/trans.png)
[英]Why Git is not showing merge conflicts when a deleted file in branch is merged with master that has that file
[英]Git merge not showing conflicts when file is replaced
我一直在尝试执行以下操作:
您已对 master 分支上的 test.txt 进行了更改并将更改推送到 master
现在索引将指向最新提交 - 提交 test.txt 的更改
创建新分支并对同一文件 test.txt 进行更改并尝试将新分支合并到 master 后,它不会引发冲突,因为两个索引都将指向同一个提交。
您将遇到以下情况的冲突,而不是上述情况
git pull origin master
git branch Branch1
git branch Branch2
当你尝试
git branch
* master
Branch1
Branch2
git checkout Branch1
更改 test.txt 并提交
git checkout master
git merge Branch1
git checkout Branch2
更改 test.txt 并提交
git checkout master
git merge Branch2
当您尝试合并 Branch2 时,您会遇到冲突,因为两个分支都对同一文件进行了修改
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.