To remove a file from Git’s tracking history that is now listed in .gitignore, you need to use the git rm command with the --cached option followed by the file name. This will remove the file from Git’s index while preserving the file in your working directory.
For example, if you want to remove a file named “example.txt” from Git’s tracking history, you can use the following command:
git rm --cached example.txt
After running this command, Git will no longer track changes
to "example.txt," but the file will remain in your working directory.
Additionally, make sure to commit the changes by using the git commit command
to save the removal of the file from Git's history.