title: How to copy code change in git from 1 file to another
body: <p>I am new to Git and was exploring a possibility. My requirement was</p>
  
  <blockquote>
    <p>1) If a made a change to a file in a git repository, how can I automatically copy and commit the changes in another file in the same repository.</p>
  </blockquote>
  
  <p><em>Example</em></p>
  
  <p>There is an SQL file, this is the main SQL file, and there is an <code>upgrade.sql</code> file. If I made any changes in <code>main.sql</code>, how can I copy the changes in <code>update.sql</code> file?</p>