title: Git: identify lines moved from another file
body: <p>I have a commit, which cuts chunks out of a couple of files and puts them into a couple of new files, without changing or adding lines, in a single commit. The absence of changes or additions was verified manually with vimdiff.</p>
  
  <p>Is it possible to use git to find out which lines were moved from which files and whether there were lines added to the new files in that commit? If yes, then how?</p>
  
  <p><code>git blame -C file</code> still attributes some chunks as belonging to the new file.</p>
  
  <p>For example, in one destination file, where this reproduces, there were two chunks moved from one original file: one 388 lines, another 30 lines. In this case <code>git blame -C file</code> attributes 12 chunks to the new file at HEAD, interspersed with chunks attributed to the original file at older revisions.</p>
  
  <p>A simple synthetic test produces expected results:</p>
  
  <pre><code>git init
  xxd -p -cols 32 -len 32000 /dev/urandom &gt; a
  git add a
  git commit -m 'Add a'
  sed -ne '100,487p; 600,629p' a &gt; b
  sed -i -e '100,487d; 600,629d' a
  git add *
  git commit -m 'Move pieces of a to b'
  git blame -C b
  </code></pre>
  
  <p>However, the real commit modifies different content and has a long history preceding it.</p>