From: https://medium.com/better-programming/how-to-remove-committed-files-from-git-version-control-b6533b8f9044
- Create a
.gitignore
file, if you haven’t already - Edit
.gitignore
to match the file/folder you want to ignore - Execute the following command:
git rm --cached path/to/file
- Git will list the files it has deleted. The
--cached
flag should be used if you want to keep the local copy but remove it from the repository. - Verify that these files are being deleted from version control using
git status
- Push the changes to the repository
After completing these steps, those files should be removed from version control but not removed from any local machine. Any other developer which pulls again after you pushed your changes should have no issues.