A file that already exists in a local repository is updated. Which command must be executed to ensure that the changes in the file are included in the next Git commit?
To ensure that changes in a file that already exists in a local repository are included in the next Git commit, the git add command must be executed. This command stages the changes in the specified file(s) so they will be included in the next commit.
A. git update - Incorrect. There is no git update command. B. git merge - Incorrect. This command is used to merge branches, not to stage changes. C. git add - Correct. This command stages changes in the working directory to be included in the next commit. D. git rebase - Incorrect. This command is used to reapply commits on top of another base tip.
References:
Git Basics - Recording Changes to the Repository
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit