Getting error while removing node_modules
in git, vscode terminal
git rm -r --cached node_modules
Error:
Once git starts tracking a file or a folder it won't stop even if you add it to .gitignore
You will need to delete it from the .git repository. I exclusively use a local one, typically located at the root of the project's source.
As of today 20200408, it does not appear there is a mouse click approach to remove the annoying file/folder from git.
You will have to use the terminal.
Press Ctrl-J then select Terminal tab
or from VSCode menu select Terminal / New Terminal
Then issue something like the following command
git rm -r --cached www/index.html
The following exclude
www/
was already in my .gitignore file.
In your case you would want to add the "cancer folder" :)
node_modules/
PS: Simple things made unnecessarily hard, I wonder why?
Below is the zillion garbage of Git commands I never use. Enjoy!