nerdexam
CompTIACompTIA

XK0-005 · Question #1402

XK0-005 Question #1402: Real Exam Question with Answer & Explanation

The correct answer is C: git reflog. The git reflog command is used to display a log of all operations that have updated the HEAD of the repository and other references, showing a history of changes made locally to the repository's state.

System Management

Question

A systems administrator wants to check the log of changes made to a Git repository. Which of the following commands can be used for this task?

Options

  • Agit commit log
  • Bgit branch list
  • Cgit reflog
  • Dgit push log

Explanation

The git reflog command is used to display a log of all operations that have updated the HEAD of the repository and other references, showing a history of changes made locally to the repository's state.

Common mistakes.

  • A. 'git commit log' is not a valid Git command; the correct command to view commit history is git log.
  • B. The git branch list command is not a valid Git command; git branch lists local branches.
  • D. 'git push log' is not a standard Git command and does not display a log of changes made to the repository.

Concept tested. Git repository history and recovery

Reference. https://git-scm.com/docs/git-reflog

Topics

#Git#Version Control#Command Line#Repository Management

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions