Which of the following commands will delete the file?

A systems administrator wants to delete app . conf from a Git repository.

Which of the following commands will delete the file?
A . git tag app. conf
B . git commit app . conf
C . git checkout app . conf
D . git rm app. conf

Answer: D

Explanation:

To delete a file from a Git repository, the administrator can use the command git rm app.conf (D). This will remove the file “app.conf” from the working directory and stage it for deletion from the repository. The administrator can then commit the change with git commit -m "Delete app.conf" to finalize the deletion. The other commands will not delete the file, but either tag, commit, or checkout the file.

References:

[CompTIA Linux+ Study Guide], Chapter 10: Working with Git, Section: Deleting Files with Git

[How to Delete Files from Git]

Latest XK0-005 Dumps Valid Version with 136 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments