Remove a file from the repo and add it to .gitignore git rm --cached resources/sprite/dist/sprite.svg Remove a all file from a folder in a repo and add it to .gitignore git rm -r --cached resources/sprite/svgo