Which command shows the history of commits?

Dive into the Architect Journey – Development Lifecycle and Deployment Exam. Prep with tailored flashcards, explore multiple choice questions with detailed explanations, and enhance your readiness for the test!

Multiple Choice

Which command shows the history of commits?

Explanation:
Seeing the record of past commits in a repository is handled by the git log command. It shows the commit history for the current branch (and you can extend it to other refs or all branches with options). Each entry includes the commit hash, author, date, and commit message, giving you a clear timeline of changes and who made them. This is the main way to review what happened in the project, track when specific changes were made, and locate a particular change or author. You can tailor the output with flags like --oneline to keep it concise, --graph to visualize branching, or --decorate to show branch names and tags. The other commands don’t display the history: git status reports the current state of the working directory and staging area, not the sequence of past commits; git revert creates a new commit that undoes changes from a previous commit rather than showing the history; git history isn’t a standard Git command.

Seeing the record of past commits in a repository is handled by the git log command. It shows the commit history for the current branch (and you can extend it to other refs or all branches with options). Each entry includes the commit hash, author, date, and commit message, giving you a clear timeline of changes and who made them. This is the main way to review what happened in the project, track when specific changes were made, and locate a particular change or author. You can tailor the output with flags like --oneline to keep it concise, --graph to visualize branching, or --decorate to show branch names and tags. The other commands don’t display the history: git status reports the current state of the working directory and staging area, not the sequence of past commits; git revert creates a new commit that undoes changes from a previous commit rather than showing the history; git history isn’t a standard Git command.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy