0
0
Gitdevops~20 mins

git log --oneline and --graph - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Git Log Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
Understanding git log --oneline output
What is the output format of the command git log --oneline?
Git
git log --oneline
AA graphical tree of commits with branch and merge lines.
BA list of commits showing only the commit hash and the commit message in a single line per commit.
CA list of files changed in the last commit.
DA detailed list of commits showing author, date, and full commit message.
Attempts:
2 left
💡 Hint
Think about what 'oneline' means for the commit display.
💻 Command Output
intermediate
1:30remaining
Effect of --graph option in git log
What does the --graph option add to the output of git log?
Git
git log --graph
AIt adds a text-based graphical representation of the commit history showing branches and merges.
BIt outputs the commit history in JSON format.
CIt filters commits to only those that changed files in the current directory.
DIt shows only the commit hashes without messages.
Attempts:
2 left
💡 Hint
Think about how git visually shows branching.
🔀 Workflow
advanced
2:00remaining
Combining --oneline and --graph for commit history
Which command correctly shows a compact, graphical commit history with one line per commit?
Agit log --oneline --patch
Bgit log --graph --stat
Cgit log --oneline --graph
Dgit log --graph --name-only
Attempts:
2 left
💡 Hint
You want both a graph and a short summary per commit.
Troubleshoot
advanced
2:00remaining
Why does git log --graph output look misaligned?
You run git log --oneline --graph but the graph lines appear misaligned or broken in your terminal. What is the most likely cause?
AYour terminal font does not support the characters used for the graph lines.
BYou forgot to add the <code>--decorate</code> option.
CThe repository has no commits.
DYou ran the command outside a git repository.
Attempts:
2 left
💡 Hint
Think about how the graph is drawn using special characters.
🧠 Conceptual
expert
2:30remaining
Understanding the difference between --oneline and --graph
Which statement best describes the difference between git log --oneline and git log --graph?
A<code>--oneline</code> shows only branch names; <code>--graph</code> shows commit messages.
B<code>--oneline</code> filters commits by author; <code>--graph</code> filters commits by date.
C<code>--oneline</code> shows a graphical tree; <code>--graph</code> shows commit hashes only.
D<code>--oneline</code> shortens commit info to one line; <code>--graph</code> adds a visual branch structure but does not shorten commit info.
Attempts:
2 left
💡 Hint
Consider what each option changes in the commit log output.