What is `.gitignore` and why doesn't it ignore a file already tracked?
IntermediateConceptGit
Answer
.gitignore only affects untracked files. To stop tracking a file that's already committed, remove it from the index:
git rm --cached secrets.env
.gitignore only affects untracked files. To stop tracking a file that's already committed, remove it from the index:
git rm --cached secrets.env