Recall & Review
beginner
What does the command
git log do?It shows the list of commits made in the current branch, displaying details like commit ID, author, date, and message.
Click to reveal answer
beginner
How can you view a simplified one-line summary of each commit using
git log?Use
git log --oneline to see each commit as a single line with a short commit ID and the commit message.Click to reveal answer
intermediate
What option would you add to
git log to see the changes made in each commit?Add
-p to git log to show the patch (diff) introduced by each commit.Click to reveal answer
beginner
How do you limit the number of commits shown by
git log?Use
git log -n <number> to show only the last <number> commits. For example, git log -n 3 shows the last 3 commits.Click to reveal answer
intermediate
What does the
--graph option do when used with git log?It shows a text-based graph of the branch structure and commit history, helping visualize merges and branches.
Click to reveal answer
Which command shows a simple one-line summary of each commit?
✗ Incorrect
git log --oneline shows each commit in a short, one-line format.
How do you see the detailed changes introduced by each commit?
✗ Incorrect
git log -p shows the patch (diff) for each commit in the log.
What does
git log -n 5 do?✗ Incorrect
The -n option limits the number of commits shown to the specified number.
Which option adds a visual graph of branches to the commit history?
✗ Incorrect
--graph draws a text-based graph showing branch and merge history.
What information is NOT shown by default in
git log?✗ Incorrect
By default, git log does not show files changed; use -p or --stat for that.
Explain how to use
git log to view a simple list of recent commits with short IDs and messages.Think about a command that makes the log easier to read quickly.
You got /4 concepts.
Describe how to see the actual changes made in each commit using git commands.
Look for an option that shows differences inside the log.
You got /4 concepts.