Say I have a file foo.js
that was committed some time ago. I would like to
simply find the commit where this file was first added.
After reading the answers and my own tinkering, this works for me
git log --follow --diff-filter=A --find-renames=40% foo.js