nerdexam
CompTIA

XK0-004 · Question #407

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 shows a chronological log of all reference changes in a local Git repository, making it the correct tool for auditing repository history.

Scripting, Containers and Automation

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

How the community answered

(57 responses)
  • A
    7% (4)
  • B
    2% (1)
  • C
    88% (50)
  • D
    4% (2)

Why each option

The git reflog command shows a chronological log of all reference changes in a local Git repository, making it the correct tool for auditing repository history.

Agit commit log

'git commit log' is not a valid Git command - the correct command for viewing commit history is 'git log', and 'commit' cannot be inserted between git and log.

Bgit branch list

'git branch list' is not a valid Git subcommand combination - listing branches uses 'git branch' or 'git branch --list', and it shows branch names, not a change log.

Cgit reflogCorrect

git reflog records every movement of HEAD and branch pointers, including commits, checkouts, merges, and resets, giving a complete audit trail of changes made to the repository. Unlike git log which only shows the current branch's commit history, reflog captures actions that may not appear in the commit graph, making it especially useful for reviewing all changes.

Dgit push log

'git push log' is not a valid Git command - 'git push' sends commits to a remote repository and has no 'log' subcommand.

Concept tested: Git reference log for auditing repository changes

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

Topics

#git#version control#git reflog#commit history

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice