Git Log Exploration Cheatsheet
Ultimate All-in-One (Graph, Full Message/MR Description, and Code Diff)
git log --graph --patch --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset%n%n%w(80,2,2)%B%n'
Search Commit Messages for Specific Keywords
git log --grep="search term"
Find Commits that Added or Removed Specific Code Strings
git log -S"code_snippet"
git log --author="Name"
View Commits Within a Specific Date Range
git log --since="1 week ago" --until="yesterday"
See History for a Specific File Only
git log --follow -p -- "path/to/file"
Compare Differences Between Two Branches
git log branchA..branchB --oneline --graph
Summary of Changed Files and Line Counts (No Diff)
git log --stat
View the Last N Commits with Full Descriptions
git log -n 5 --pretty=format:'%h %s%n%b'
List Commits Excluding Merge Commits
git log --no-merges --oneline
Show Details and Diff of a Single Specific Commit
git show <commit_hash>