title: Do git conflict resolution files not always represent every line in the source files?
body: <p>I'm working in a repo with three branches: master, stage, and dev. I've been working on dev for a while, am ready to push my changes, and have already squashed my local commits into a single commit for publishing. I want to update my local repo with any work that's been pushed to the remote's 'stage' branch by team members. I want to:</p>
  
  <ol>
  <li>Pull any changes pushed to stage while I was working on dev</li>
  <li>Rebase the single commit on 'dev' that represents my work onto 'stage'</li>
  <li>Other stuff related to publishing</li>
  </ol>
  
  <p>(Nobody else refers to my local dev branch, so I'm comfortable rebasing.)</p>
  
  <p>I do:</p>
  
  <pre><code>git checkout stage
  git pull
  git checkout dev
  </code></pre>
  
  <p>Here's the situation:</p>
  
  <p><strong>foo.cpp on branch dev (out of date)</strong></p>
  
  <pre><code>...
  if (conditional)
  {
      Datastructure data = someValue;
      cout &lt;&lt; "Some text" &lt;&lt; endl;
      cout &lt;&lt; "More text" &lt;&lt; endl;
  }
  
  return 0; // rest of function NYI
  
  if (someOtherConditional) {
  
      Bob bob = makeBob();
      Fred fred = makeFred();
      ...
  }
  ...
  </code></pre>
  
  <p><strong>foo.cpp on branch stage (more recent)</strong></p>
  
  <pre><code>...
  if (conditional)
  {
      Datastructure data = someValue;
      cout &lt;&lt; "Some text" &lt;&lt; endl;
      cout &lt;&lt; "More text" &lt;&lt; endl;
  
      cout &lt;&lt; "Even more text" &lt;&lt; endl;
      cout &lt;&lt; "Lots of text" &lt;&lt; endl;
  
      // todo: fix this hackish code
      if (anotherConditional) {
          myBool = true;
      }
  }
  
  if (yetAnotherConditional) {
      Bob bob = makeBob();
      Fred fred = makeFred();
      ...
  }
  ...
  </code></pre>
  
  <p>Finally, I do:</p>
  
  <pre><code>git rebase stage
  </code></pre>
  
  <p>I get a few conflicts, including foo.cpp. I open foo.cpp up and get:</p>
  
  <p><strong>foo.cpp after starting to rebase dev onto stage</strong></p>
  
  <pre><code>...
  if (conditional)
  {
      Datastructure data = someValue;
      cout &lt;&lt; "Some text" &lt;&lt; endl;
      cout &lt;&lt; "More text" &lt;&lt; endl;
  
  &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD
      cout &lt;&lt; "Even more text" &lt;&lt; endl;
      cout &lt;&lt; "Lots of text" &lt;&lt; endl;
  
      // todo: fix this hackish code
      if (anotherConditional) {
          myBool = true;
      }
  }
  =======
  return 0; // rest of function NYI
  
  if (someOtherConditional) {
  &gt;&gt;&gt;&gt;&gt;&gt;&gt; mostRecentDevCommit
  
  if (yetAnotherConditional) {
      Bob bob = makeBob();
      Fred fred = makeFred();
      ...
  }
  ...
  </code></pre>
  
  <p>What happened to the missing closing bracket matching the first <code>if (conditional) {</code> within <code>mostRecentDevCommit</code>?</p>
  
  <p>And why is <code>if (yetAnotherConditional) {</code> outside the conflict-resolution section - foo.cpp on branch 'dev' doesn't have that!</p>
  
  <p>Thanks - I actually don't need to figure this out to resolve the conflict, but I'd like to know what Git's doing here.</p>