Viewing History

View saved

List recent commits

git log shows commit hashes, authors, dates, and messages. A compact view is often easier to scan.

git log
git log --oneline --graph --decorate

Inspect one commit

git show displays a commit message and the patch it introduced. You can pass a short or full hash from git log.

git show
git show HEAD

Compare unstaged changes

With no arguments, git diff shows edits in the working tree that are not yet staged.

git diff

Compare staged or committed work

Use --staged for the staging area, or compare two commits when reviewing history.

git diff --staged
git diff HEAD~1 HEAD

Comments

One comment per signed-in account. Comments are saved with this page’s URL.