How to get the hash of the commit in which a deleted line was added?
<p>When doing <code>git diff</code>, the old line and now line are shown next to each other, e.g:</p>

<pre><code>-    @principal.connections.joins(:contact_infos)
+    @principal.connections.joins(:node)
</code></pre>

<p>Is there any command, or parameter, which will cause git to print the hash of the commit in which the deleted line was added?</p>

<p>For example, if the line <code>@principal.connections.joins(:contact_infos)</code> was added in the commit <code>foo1234</code> and changed to <code>@principal.connections.joins(:node)</code> in the commit <code>bar1234</code>, then is there a way to get:</p>

<pre><code>- foo1234   @principal.connections.joins(:contact_infos)
+    @principal.connections.joins(:node)
</code></pre>

<p>When doing <code>git diff</code>, or another command which will give a list of deleted lines and the hash in which they were added?</p>

<p>Closest I came was <code>git blame</code> but that only gives hashes for lines which are currently in the file, not ones which were modified / deleted</p>