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

Viewing Changes with git diff

This lesson covers checking exactly what changed with git diff. It's for anyone searching "git diff usage."

git diff shows exactly what changed, line by line, in files you haven't staged yet. Reviewing changes with it before committing is a habit worth building for peace of mind.

In Try It, run git diff. Removed lines appear in red and added lines in green, so you can see at a glance exactly what was rewritten.

A common early mistake is running git diff when there's genuinely nothing changed and being confused by the blank output — that's actually the correct, expected behavior, signaling "no changes." In real teams, running git diff as a final check right before committing — to catch any change that snuck in by accident — is considered an important habit.

Git
Try it (type this into the pseudo terminal)
git diff

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