Remove node_modules from git in vscode

Mano picture Mano · Jun 4, 2018 · Viewed 43.2k times · Source

Getting error while removing node_modules in git, vscode terminal

 git rm -r --cached node_modules

Error:

fatal error: pathspec 'node_modules' did not match any files

Answer

Karavolt picture Karavolt · Jun 4, 2018
  1. make .gitignore file.
  2. add node_modules/ line to gitignore file
  3. run this command git rm -r --cached . git add . git commit -m "remove gitignore files" git push