Use git log when you need to inspect commit history, trace a change, understand branch relationships, or filter commits by author or date.
git loggit log --onelinegit log --oneline --graph --decorate --allThis is especially helpful when you want to understand merges and parallel branch development.
git log -n 5git log --author="Alice"git log --since="7 days ago"git log -- <filename>Example:
git log -- README.mdgit log --statgit log -pA common log command for day-to-day work is:
git log --oneline --graph --decorate -n 10git logshows committed history, not uncommitted working tree changes.- To inspect uncommitted changes, use
git statusorgit diffinstead.