Git · Junior · Question 10 of 75

What does git rm --cached file do?

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.

Further reading

Problem with a question

Git · Junior · question 10

Test yourself

Take the Git · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz