nerdexam
CompTIA

XK0-005 · Question #10440

A new file was added to a main Git repository. An administrator wants to synchronize a local copy with the contents of the main repository. Which of the following commands should the administrator…

The correct answer is B. git pull. 'git pull' fetches changes from the remote (main) repository and merges them into the current local branch, effectively synchronizing the local copy with any new commits or files added upstream. 'git push' does the opposite - it sends local changes to the remote. 'git status'…

Scripting, Containers, and Automation

Question

A new file was added to a main Git repository. An administrator wants to synchronize a local copy with the contents of the main repository. Which of the following commands should the administrator use for this task?

Options

  • Agit reflog
  • Bgit pull
  • Cgit status
  • Dgit push

How the community answered

(51 responses)
  • A
    2% (1)
  • B
    88% (45)
  • C
    6% (3)
  • D
    4% (2)

Explanation

'git pull' fetches changes from the remote (main) repository and merges them into the current local branch, effectively synchronizing the local copy with any new commits or files added upstream. 'git push' does the opposite - it sends local changes to the remote. 'git status' only shows the state of the working tree and staging area; it does not retrieve any data. 'git reflog' shows a log of where HEAD and branch refs have pointed locally and has nothing to do with syncing with a remote.

Topics

#Git#Version Control#Repository Synchronization

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice