32 | Comparing Differences |
Gitâs log provides you with the information about a changeâwho
made it, what their intent was, and so onâbut sometimes looking
at the changes made to the code provides more information.
git diff
shows you
the changes that were made between two commits.
You can use git diff
to view the
changesâreferred to as diffs or patchesâof two different
commits or states. Most of the time itâs called as git
diff
with no parameters. Thatâs the same as telling
Git, âShow me the changes between my working tree and the
staging area.â
git diff
considers changes that are staged and ready to be committed as part of the repository. You can tell Git to show the differences between what is staged and what is stored ...
Get Pragmatic Guide to Git now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.