Why does git does not merge some changes?

537 views Asked by At

We ran into a strange git merge issue. We have 2 repos (simplication below). The PublicRepo is where we do most development on and every now and then we pull/merge changes into PrivateRepo.

https://github.com/suwatch/PublicRepo

https://github.com/suwatch/PrivateRepo

if we clone PublicRepo and make change to kudu.web/kudu.web.csproj by removing below lines and commit.

<Reference Include="Microsoft.Json, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
  <HintPath>..\packages\JsonValue.0.6.0\lib\40\Microsoft.Json.dll</HintPath>
</Reference>

When trying to pull/merge this change from PublicRepo -> PrivateRepo, the automerge simply ignored this change and not removed anything. Try with different lines, it does work (removed properly). I wonder what could be the issue? Where to start investigating? What do we have to do to correct this - besides having to review all auto-merged files everytime we pull/merge?

Thanks!

1

There are 1 answers

3
Faruk Sahin On BEST ANSWER

You have

*.csproj text=auto merge=union 

in your .gitattributes file. The union merge will concatenate lines from all the refs.