0
0
Gitdevops~5 mins

git log formatting options - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the --oneline option do in git log?
It shows each commit as a single line with the commit hash and the commit message summary, making the log shorter and easier to read.
Click to reveal answer
beginner
How does the --graph option enhance the git log output?
It adds a text-based graph showing the branch structure and merges, helping visualize the commit history.
Click to reveal answer
intermediate
What is the purpose of the --pretty=format:"%h - %an, %ar : %s" option?
It customizes the log output to show the short commit hash, author name, relative date, and commit message in a specific format.
Click to reveal answer
intermediate
Explain the difference between --stat and --patch options in git log.
--stat shows a summary of changed files and lines added or removed. --patch shows the full changes (diff) made in each commit.
Click to reveal answer
beginner
What does the --abbrev-commit option do in git log?
It shortens the commit hash to a shorter unique prefix, making the log output more compact.
Click to reveal answer
Which git log option shows a simple one-line summary per commit?
A--oneline
B--patch
C--stat
D--graph
What does the --graph option add to the git log output?
ACommit timestamps only
BFull patch details
CAuthor email addresses
DA visual branch and merge graph
Which option shows the detailed changes made in each commit?
A--patch
B--stat
C--oneline
D--abbrev-commit
How can you customize the output format of git log?
AUsing <code>--stat</code>
BUsing <code>--oneline</code>
CUsing <code>--pretty=format:"..."</code>
DUsing <code>--graph</code>
What does --abbrev-commit do?
AShows full commit hashes
BShortens commit hashes
CShows author names only
DShows commit dates only
Describe three different ways to format the output of git log and what each shows.
Think about simple, visual, and custom formats.
You got /3 concepts.
    Explain the difference between --stat and --patch options in git log.
    One shows summary, the other shows details.
    You got /2 concepts.