DELAPARRA
Index
Color
NL
Category: Git commands

git diff

Explained by Updated

What is git diff?

git diff: Show what has changed between commits, branches, or in the working directory. git diff shows what changed. Without arguments, it shows unstaged changes in your working folder. git diff --staged shows what you are about to commit, and git diff main..feature compares two branches. Reading your own diff before committing is one of the best habits in development. It catches leftover debug lines, accidental changes and files you did not mean to include.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about git diff

What should you keep in mind with git diff?

A few options help. --stat gives a summary of changed files and line counts, -w ignores whitespace changes, and --word-diff marks changed words instead of whole lines, which is useful for text and documentation. Most editors and Git tools show diffs visually too, but the command line version works everywhere, including on a server.

At a glance

CategoryGit commands
Explained by
Updated

More Git commands terms

All terms starting with G

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.