4

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!

Suwat Ch
  • 598
  • 3
  • 5

1 Answers1

3

You have

*.csproj text=auto merge=union 

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

Faruk Sahin
  • 8,406
  • 5
  • 28
  • 34
  • Ah yes, that's most likely it! No idea why it got set this way, as that feels wrong for a .csproj file. We'll change it. Thanks! – David Ebbo Oct 17 '12 at 16:38
  • Thanks, that's it. Removing those yield the conflict now. I still cannot explain why it works for other part of the file. – Suwat Ch Oct 17 '12 at 23:36
  • I received mixed results with this setting. When people were adding files at around the same place in the project files, the union merge would cause the file to have duplicate entries, which fails the build. – mbp Dec 19 '12 at 15:42