Remove node_modules from git in vscode

后端 未结 7 1417
误落风尘
误落风尘 2021-01-29 19:37

Getting error while removing node_modules in git, vscode terminal

 git rm -r --cached node_modules

Error:

7条回答
  •  隐瞒了意图╮
    2021-01-29 20:08

    You can remove folders from git without the command-line using vs-code.
    If you want to remove node_modules from git:

    1. rename node_modules to node_modulesx
    2. add node_modulesx to .gitignore (create a .gitignore file if you need to)
    3. commit

    The above 3 steps will remove the node_modules folder from git.

    1. rename node_modulesx back to node_modules
    2. now add node_modules to .gitignore (or change node_modulesx to node_modules in your .gitignore)
    3. commit

    Now your node_modules folder still exists, but will not be committed to git anymore.

提交回复
热议问题