问题描述
我们有一个MVC5 Web应用程序,我很困惑为什么git告诉我2个分支是最新的.
We have an MVC5 web application and I am confused why git is telling me 2 branches are up-to-date.
两个分支是master
和feature1
.当我在feature1
上并执行git merge master
时,我会得到
The two branches are master
and feature1
. When I am on feature1
and do git merge master
I get
这没有意义,因为分支不同.
This doesn't make sense as the branches are not the same.
我们已经检查了Beyond Compare,发现有几个不同的文件-以一个为例feature1
的文件注释掉了一行,在master
的同一行是不是已注释掉.
We have checked with Beyond Compare and there are several files which are different - taking one as an example feature1
has a file where a line is commented out, in master
the same line is not commented out.
我检查了本地存储库是否与远程存储库相同.
I have checked that my local repo has the same as the remote (it is).
为什么git告诉我这些分支是相同的,但它们之间有差异?
Why is git telling me these branches are the same, when they have differences?
推荐答案
进行合并并不意味着分支将变得相同.只是不同分支的新更改将合并到现有分支上.
Doing a merge doesn't mean that the branches will become same. It's just that the new changes of the different branch will be merged onto the existing branch.
如果在feature1分支中有一行注释掉了,而这当然是在从母版中删除之后完成的,那么从母版合并将不会删除该注释.
If you have a line commented out in the feature1 branch and that was of course done after it was taken out from the master, then merging from master will not remove that comment.
这篇关于为什么git merge说两个分支是最新的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!