How do you remove a file from both the working directory and Git index?
a)
git delete fileb)
git rm filec)
git remove filed)
git reset fileAnswer:
b)
git rm fileExplanation:
The git rm file command removes a file from both the working directory and the Git index (staging area). This means the file will no longer be tracked by Git, and it will also be deleted from your local file system.
For example, running git rm filename will stage the file for deletion in the next commit and remove it from your local directory.
Use this command when you want to permanently remove a file from the project and stop tracking it in future commits.