nerdexam
CompTIACompTIA

XK0-005 · Question #1639

XK0-005 Question #1639: Real Exam Question with Answer & Explanation

The correct answer is D: git rm app.conf. 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 "Delet

Scripting, Containers, and Automation

Question

A systems administrator wants to delete app.conf from a Git repository. Which of the following commands will delete the file?

Options

  • Agit tag app.conf
  • Bgit commit app.conf
  • Cgit checkout app.conf
  • Dgit rm app.conf

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.

Topics

#Git#Version Control#File Management#CLI

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions