re: 11 Painful Git Interview Questions You Will Cry On VIEW POST

FULL DISCUSSION
 

Q10: How to remove a file from git without removing it from your file system?

I think a better way to do this is git rm --cached filename ?? Correct me if i am wrong !

 

You are correct. From git-rm documentation

--cached
Use this option to unstage and remove paths only from the index. Working tree files, whether modified or not, will be left alone.
code of conduct - report abuse