title: Merging only certain changes from one git branch to another
body: <p>Say I have a git repository with two branches - <code>main</code> and <code>custom</code>. Say that I'm working in <code>custom</code> and I make two changes to the file <code>print.php</code>:</p>
  
  <pre><code>/* begin custom only change */
  echo "I'm only printed in the custom branch version";
  /* end custom only change */
  
  echo "I want this printed in both branches";
  </code></pre>
  
  <p>Say also that meanwhile, I've pulled a new <code>main</code> branch copy, and it has the following change to <code>print.php</code>:</p>
  
  <pre><code>echo "This should also be printed in both branches";
  </code></pre>
  
  <p>What should I do -- either with the command-line or with a git program like Tower (or even suggestions for making a custom script) -- in order to have the following resulting files?</p>
  
  <p><strong>print.php in main branch</strong></p>
  
  <pre><code>...
  echo "I want this printed in both branches";
  echo "This should also be printed in both branches";
  ...
  </code></pre>
  
  <p><strong>print.php in custom branch</strong></p>
  
  <pre><code>...
  /* begin custom only change */
  echo "I'm only printed in the custom branch version";
  /* end custom only change */
  
  echo "I want this printed in both branches";
  echo "This should also be printed in both branches";
  ...
  </code></pre>
  
  <p>Obviously the order of the <code>echo "I want this..."</code> and <code>echo "This should also..."</code> is not something that Git can figure out, so there's going to be some manual decision-making here. But I want to know how to do it in the most "Git" way possible and involving the least number of error messages from a program like Tower.</p>