You are preparing concise release notes for the file playbooks/web.yml in a Git-based automation project. You want to list exactly the last three commits that modified this file, display each commit on a single line, and show them in chronological order from the oldest to the newest so reviewers can read the changes in the order they happened. Which Git command satisfies all of these requirements?
git log --stat --since="3 days ago" -- playbooks/web.yml
The combination --oneline shortens every commit to a single line that shows an abbreviated hash and the summary message. The option -n 3 (or the equivalent --max-count=3) limits the output to the most recent three commits that match the rest of the query. Because Git normally prints commits in reverse-chronological order (newest first), adding --reverse flips the list so the oldest of the selected commits is printed first. Placing -- before the path makes the following token a pathspec, filtering the history to commits that touched playbooks/web.yml. Together, these flags meet all stated requirements, whereas the other commands either include full patches/statistics, omit the oneline format, or do not guarantee exactly three commits in chronological order.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the `--oneline` option do in Git?
Open an interactive chat with Bash
Why is `--reverse` necessary when combined with `-n 3`?
Open an interactive chat with Bash
What is the purpose of the `--` before a file path in a Git command?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Automation, Orchestration, and Scripting
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .