We will see how to ignore files that are already added previously to your git repository without using the .gitignore file. Use the following commands to achieve the same.
git rm --cached file_name_here git commit -m "Your commit message here"
Now update your .git/info/exclude file to not show the changes in your file_name_here file.
Open .git/info/exclude and add file_name_here entry there to start ignoring the file.
Have a good day! 🙂