Understanding history helps you reason about changes and collaborate effectively.
- View commit history
git log --oneline --graph --decorate --allgit log --stat
- See a specific commit
git show HEADgit show <commitSHA>
- Compare changes
git diff# unstaged changesgit diff --staged# staged vs last commitgit diff main..feature/x
- Limit and search logs
git log -n 5git log --author="Your Name" --since="1 week ago"git log -S "search-term"# pickaxe search by added/removed text
Checklist
- You can read git log output
- You can show a specific commit
- You can diff unstaged and staged changes