An engineer is working on a production application deployment that requires changing a web application property file called server.property that is managed by the Git version control 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?
Click on the arrows to vote for the correct answer
A. B. C. D.D.
https://www.earthdatascience.org/workshops/intro-version-control-git/basic-git-commands/The engineer failed to perform the git add
command.
Explanation: Git is a version control system that allows developers to track changes in source code during software development. The Git workflow typically involves the following steps:
In this scenario, the engineer made changes to the server.property file and saved it as server.property. To commit these changes, the engineer needs to stage the changes using the git add
command. This command tells Git to track changes made to the specified file and prepares it for a commit.
The correct command sequence for the workflow would be:
git add server.property
git commit -m "changed the property file server.property"
git push
Therefore, the correct answer is C. git add server.property
. The git init
command is used to create a new Git repository, and it's not necessary in this scenario. The git merge
command is used to merge changes from one branch into another, and it's not applicable in this scenario. The git push
command is used to push changes from the local repository to the remote repository, but it's not necessary until after the changes have been committed.