nerdexam
CompTIA

XK0-005 · 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. To view the history of changes made to a Git repository's references, such as the HEAD, the git reflog command is used.

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

How the community answered

(61 responses)
  • A
    2% (1)
  • B
    2% (1)
  • C
    92% (56)
  • D
    5% (3)

Why each option

To view the history of changes made to a Git repository's references, such as the HEAD, the `git reflog` command is used.

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

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

Cgit reflogCorrect

The `git reflog` command displays a log of all changes made to the local repository's references (like HEAD, branches, and stashes), showing where the HEAD pointer has been over time, including commits, resets, merges, and other operations.

Dgit push log

`git push log` is not a valid Git command; `git push` sends local commits to a remote repository and does not have a `log` subcommand.

Concept tested: Git repository history and reference logs

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

Topics

#Git#Version Control#Command Line Interface#Repository Management

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice