How to delete files from repo that are listed in gitignore


I have a project made in netbeans that has the nbproject/ directory listed in .gitignore. However, this wasn’t always the case and now that directory is showing up in the repository. I don’t want to delete my local copy of the directory. How can I get rid of the remote one?