What does the git log --oneline command do?

What does the git log --oneline command do?

a) Displays a condensed view of the commit history
b) Shows the current branch
c) Displays the differences between commits
d) Displays the working directory status

Answer:

a) Displays a condensed view of the commit history

Explanation:

The git log --oneline command displays the commit history in a condensed format, showing only the commit hash and message in a single line for each commit. This provides a more readable and compact view of the repository’s history.

For example, running git log --oneline outputs a simplified list of all commits, making it easier to quickly review past changes.

This command is useful when you want a quick overview of the repository’s history without detailed commit information.

Reference:

Top 100 Git and GitHub MCQ Questions and Answers

Scroll to Top