nerdexam
CompTIA

XK0-005 · Question #1402

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?

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?

Exhibit

XK0-005 question #1402 exhibit

Options

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

How the community answered

(27 responses)
  • A
    4% (1)
  • C
    93% (25)
  • D
    4% (1)

Why each option

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.

Agit commit log

'git commit log' is not a valid Git command; the correct command to view commit history is `git log`.

Bgit branch list

The `git branch list` command is not a valid Git command; `git branch` lists local branches.

Cgit reflogCorrect

The `git reflog` command displays a log of all actions that have modified the HEAD of the repository, including commits, merges, rebases, and resets, providing a comprehensive history of local repository changes that affect reference pointers.

Dgit push log

'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

Source: 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 Practice