nerdexam
CompTIA

XK0-005 · Question #644

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

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…

System Management

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

How the community answered

(32 responses)
  • A
    6% (2)
  • B
    3% (1)
  • D
    91% (29)

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#Command Line

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice