If I have a repo with files that were previously not in my .gitignore
file that I now want to ignore, how do I do this without deleting the files locally and when you pull from the repo?
git rm --cached somefile
will preserve the local copy of the file but make git stop tracking that file. Once you do that, you can add the file to .gitignore
too.