0
0
Gitdevops~5 mins

Viewing commit history with git log - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
Agit log -p
Bgit log --oneline
Cgit status
Dgit diff
How do you see the detailed changes introduced by each commit?
Agit log -p
Bgit log --oneline
Cgit show
Dgit diff HEAD
What does git log -n 5 do?
AShows commits with 5 files changed
BShows commits from 5 days ago
CShows commits with 5 authors
DShows the last 5 commits
Which option adds a visual graph of branches to the commit history?
A--stat
B--oneline
C--graph
D-p
What information is NOT shown by default in git log?
AFiles changed in the commit
BAuthor name
CDate of commit
DCommit message
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.