Git Blame
git blame shows, for each line of a file, the commit that last changed it, who made that commit and when.
A hash that starts with ^ belongs to the first commit of the file's history.
Blame a file
git blame index.html
^21e6719 (W3Schools Test 2026-11-05 10:58:34 +0100 1) <h1>Hello world!</h1>
c2ddb8aa (W3Schools Test 2026-11-05 10:58:34 +0100 2) <p>Welcome to Git</p>
99f85846 (Emma 2026-11-05 10:58:35 +0100 3) <p>Read the docs</p>
Blame only some lines
git blame -L 2,3 index.html
c2ddb8aa (W3Schools Test 2026-11-05 10:58:34 +0100 2) <p>Welcome to Git</p>
99f85846 (Emma 2026-11-05 10:58:35 +0100 3) <p>Read the docs</p>