๐ HistoryCommonly used
How to view commit history in Git
Browse and search through past commits.
View commit log
git logShows full commit history with hash, author, date and message.
Compact one-line log
git log --onelineShows each commit on one line with short hash and message.
When to use: Quick overview of recent history.
Log with branch graph
git log --oneline --graph --allVisual ASCII graph showing branches and merges.
When to use: Understanding branching history.
Log for a specific file
git log --follow filename.txtShows only commits that touched a specific file.
When to use: Tracing the history of a specific file.
Log by author
git log --author="John"Filters commits by author name.
Log since a date
git log --since="2 weeks ago"Shows commits from the last 2 weeks.