Git & GitHub Interview Question #16
What does git log do?
Git Fundamentals, Repository, Working Tree, Staging, Commits & Branch Basics Junior Beginner
Quick Interview Answer
git log displays commit history. By default it shows information such as commit IDs, authors, dates, and messages, while options can produce compact graphs or filter the history.
Detailed Explanation
git log displays commit history. By default it shows information such as commit IDs, authors, dates, and messages, while options can produce compact graphs or filter the history.
Developers use git log to understand how a branch evolved, locate commits, investigate regressions, and obtain commit IDs for other Git operations.
Code Example
git log
git log --oneline
git log --oneline --graph --decorate --all