Remove files from Git's index without deleting the actual file

To remove a file from the Git version control system without actually removing the file on disc, use

git rm --cached file
where file is the name of the file to be deleted. See also How do I untrack a file?.

Copyright © Ben Bullock 2009-2023. All rights reserved. For comments, questions, and corrections, please email Ben Bullock ( or use the discussion group at Google Groups. / Privacy / Disclaimer