title: Conflict when merging two branches with git
body: <p>I have a problem with merging 2 branches. I have a xml file with the following content:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="sk" xsi:noNamespaceSchemaLocation="language.xsd"&gt;
    &lt;topic name="topicName"&gt;
      &lt;section name="sectionName"&gt;
        &lt;pair key="key_1" state="0"&gt;value 1&lt;/pair&gt;
        &lt;pair key="key_2" state="0"&gt;value 2&lt;/pair&gt;
      &lt;/section&gt;
    &lt;/topic&gt;
  &lt;/language&gt;
  </code></pre>
  
  <p>Then the following case:</p>
  
  <p>The branch "master" changes at the xml file only the "state" from "0" to "1". i.e.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="sk" xsi:noNamespaceSchemaLocation="language.xsd"&gt;
    &lt;topic name="topicName"&gt;
      &lt;section name="sectionName"&gt;
        &lt;pair key="key_1" state="1"&gt;value 1&lt;/pair&gt;
        &lt;pair key="key_2" state="1"&gt;value 2&lt;/pair&gt;
      &lt;/section&gt;
    &lt;/topic&gt;
  &lt;/language&gt;
  </code></pre>
  
  <p>the changes are than commited and pushed to te cenral repository.</p>
  
  <p>The branch "Test" addes a new node. i.e. :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="sk" xsi:noNamespaceSchemaLocation="language.xsd"&gt;
    &lt;topic name="topicName"&gt;
      &lt;section name="sectionName"&gt;
        &lt;pair key="key_1" state="0"&gt;value 1&lt;/pair&gt;
        &lt;pair key="key_2" state="0"&gt;value 2&lt;/pair&gt;
        &lt;pair key="key_3" state="0"&gt;value 3&lt;/pair&gt;
      &lt;/section&gt;
    &lt;/topic&gt;
  &lt;/language&gt;
  </code></pre>
  
  <p>the changes are than commited and pushed to te cenral repository.</p>
  
  <p>When I merge the "Test" branch at the "master" branch I get a conflict. i.e.</p>
  
  <pre><code>[master] git pull origin Test
  </code></pre>
  
  <p>The conflicted file looks like this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="sk" xsi:noNamespaceSchemaLocation="language.xsd"&gt;
    &lt;topic name="topicName"&gt;
      &lt;section name="sectionName"&gt;
  &lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD
        &lt;pair key="key_1" state="1"&gt;value 1&lt;/pair&gt;
        &lt;pair key="key_2" state="1"&gt;value 2&lt;/pair&gt;
  =======
        &lt;pair key="key_1" state="0"&gt;value 1&lt;/pair&gt;
        &lt;pair key="key_2" state="0"&gt;value 2&lt;/pair&gt;
        &lt;pair key="key_3" state="0"&gt;value 3&lt;/pair&gt;
  &gt;&gt;&gt;&gt;&gt;&gt;&gt; b872e7d1bbbe281482baefa73e322a34c475aa92
      &lt;/section&gt;
    &lt;/topic&gt;
  &lt;/language&gt;
  </code></pre>
  
  <p>I don't understand why these kind of changes lead to conflicts. I can assure that there are no other changes on the files, like spaces, tabs or new lines. (I have reproduced this kind of conflict many times)</p>
  
  <p>When I open the conflicted file with merge tool, it shows no conflict. It shows only the changes, and the merge tool does not automatically merge the new line. 
  (I use git version 1.7.10.4)</p>
  
  <p>Can somebody explain why this happens and how can I avoid this kind of conflicts.</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>EDIT</strong>: I was searching for better merge-tools for resolving git-conflicts. I found <strong>kdiff3</strong>.
  When I did the command:</p>
  
  <pre><code>git mergetool --tool kdiff3 sk.xml
  </code></pre>
  
  <p>the tool did not show, but it did resolved the conflict automatically. I was very happy.</p>
  
  <p>Now my questions: <br/>
  1. why can not git do this? <br/>
  2. Can "kdiff3" by trusted, that it solved the conflict good? I checked manually this type of conflict I posted, and it solved the conflict good. But is there potentiall that, this tool may merge the files automatically unproperly?</p>