CompTIACompTIA
XK0-005 · Question #1231
XK0-005 Question #1231: Real Exam Question with Answer & Explanation
The correct answer is D: git pull. To update a local Git working copy with the latest changes from a remote repository, git pull is the most efficient command.
Scripting, Containers, and Automation
Question
A Linux team is using Git to version a set of custom scripts. A team member has made an update to a script and published the changes to the repository. Which of the following is the BEST way to retrieve the latest changes to the administrator's local working copy?
Options
- Agit fetch
- Bgit merge
- Cgit commit
- Dgit pull
Explanation
To update a local Git working copy with the latest changes from a remote repository, git pull is the most efficient command.
Common mistakes.
- A.
git fetchonly downloads changes from the remote repository to the local remote-tracking branches but does not integrate them into the local working branch. - B.
git mergeintegrates changes from one branch into another but does not retrieve the latest changes from a remote repository first. - C.
git commitrecords local changes to the local repository history but does not interact with remote repositories to retrieve updates.
Concept tested. Git remote repository synchronization
Reference. https://git-scm.com/docs/git-pull
Topics
#Git#Version Control#Remote Repository Synchronization#Git Workflow
Community Discussion
No community discussion yet for this question.