Git · Junior · Question 10 of 75
What does git rm --cached file do?
- 1Removes the file only from the remote repository
- 2Deletes the file from disk and from history
- ✓Correct answer: Stops tracking the file but keeps it on disk
Explanation
The file is removed from the index, so the next commit records its deletion from the repository, while the working copy stays. Without --cached it would be deleted from disk too.