Is it possible with GIT to delete a file only from the index?

GIT rm filename

delete the file from the index, as well as from the working directory. Is it possible to delete a file only from the index?

Thank you, Alessandro D.S.

+3
source share
1 answer

Use git rm --cached:

- cache

Use this option to disable and remove paths only from the index. Files of working trees, regardless of whether they are modified or not, will be left alone.

+7
source

Source: https://habr.com/ru/post/1752236/


All Articles