It is probably asked numerous time and answered even more time. I understand I need to use
git rm --cached file_name
But my problem is that above command changes file status to deleted and if I push this commit to live and pull it my .env file will be deleted and hence my site will be down immediately. I cannot afford to go down even for a split second. What can be done in this case.
Thanks