Ad space (banner)
🌿Git Lessons
Lesson 24 / 59

Finding Who Changed a File with git blame

This lesson covers finding out who changed a file with git blame. It's for anyone searching "git blame usage."

git blame shows, line by line, who changed each line of a file and in which commit. It's useful for investigating the cause of a bug.

In Try It, run git blame app.js. Each line of app.js gets prefixed with the info about the commit that most recently changed it, and the author's name.

A common early mistake is misreading the command name as a tool for "blaming" someone — in practice, it's an investigative tool for understanding the history and intent behind a change, not for assigning fault. In real teams, a typical use is "why is this code written this way?" — using blame to find the commit that changed it, then reading that commit's message to understand the background.

Git
Try it (type this into the pseudo terminal)
git blame app.js

🧑‍💻 You can type this command into the Git pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)