nerdexam
CompTIA

XK0-005 · Question #117

An engineer is working on a production application deployment that requires changing a web application property file called that is managed by the Git version control server.property system. A…

The correct answer is D. git push server.property. After committing changes locally, the engineer needs to use git push to send the local commits to the remote repository, making the changes available to others and for deployment.

System Management

Question

An engineer is working on a production application deployment that requires changing a web application property file called that is managed by the Git version control server.property system. A cloned copy of the remote repository in which the server.property file exists is on the local desktop computer. The engineer makes appropriate changes to the files, saves it as server.property, and executes git commit -m "changed the property file" server.property. Which of the following commands did the engineer fail to perform?

Options

  • Agit init server.property
  • Bgit merge server.property
  • Cgit add server.property
  • Dgit push server.property

How the community answered

(31 responses)
  • A
    3% (1)
  • C
    6% (2)
  • D
    90% (28)

Why each option

After committing changes locally, the engineer needs to use `git push` to send the local commits to the remote repository, making the changes available to others and for deployment.

Agit init server.property

The `git init` command initializes a new Git repository, which is not needed here as the repository was already cloned.

Bgit merge server.property

The `git merge` command is used to integrate changes from one branch into another, which is not the immediate missing step after a local commit for pushing to a remote.

Cgit add server.property

The `git add` command stages changes for the next commit; however, the question states `git commit` was executed, implying `git add` either preceded it or the commit failed, but if the commit succeeded, `git push` is the next step to publish changes remotely.

Dgit push server.propertyCorrect

The `git push` command is used to upload local repository commits to a remote repository, making the changes visible to other collaborators and for subsequent deployment processes. Without `git push`, the changes remain only on the local desktop computer and are not synchronized with the central version control system.

Concept tested: Git workflow - pushing local changes to remote

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

Topics

#Git#Version Control#Deployment Workflow#Remote Repository

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice