title: How to find the commit in which a given file was added?
body: <p>Say I have a file <code>foo.js</code> that was committed some time ago. I would like to
  simply find the commit where this file was first added.</p>
  
  <p>After reading the answers and my own tinkering, this works for me</p>
  
  <pre class="lang-sh prettyprint-override"><code>git log --follow --diff-filter=A --find-renames=40% foo.js
  </code></pre>