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

Viewing the Actual Changes with git log -p

This lesson covers viewing the actual content of each change with git log -p. It's for anyone searching "git log -p usage."

git log -p shows, alongside the commit history list, the actual change (the diff) made in each commit.

In Try It, run git log -p. Right beneath each commit message, the specific changes follow, color-coded red (removed) and green (added).

A common early mistake is being overwhelmed by the sheer volume of output — on a project with a lot of commits, running this produces a massive amount of text, so it's more practical to narrow it down to a specific file or commit range. In real teams, this option helps when you need to carefully investigate exactly when and in which commit a particular bug was introduced, by reading through the actual code changes.

Git
Try it (type this into the pseudo terminal)
git log -p

🧑‍💻 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)