Git: View History/Log

By Xah Lee. Date: . Last updated: .

How to get a history of commits?

show last 3 commits

git log -3

git log screenshot 2017 06 16
git log screenshot

This command is important because it shows the ID for each commit. You'll need to use the ID when doing comparisons or diff or revert.

[see Git: Diff Between {Working Dir, Staged Area, Last Commit}]

[see Git: Revert Change]

How to see last change?

# show diff of last changes
git log -p -2 --color
git log diff 2017 06 16 688ce
git log diff

git help log