如何从unstaged选项卡中删除node_modules?

问题描述 投票:1回答:2

我在Git Tab中有一些来自node_modules的非分页文件。我想删除它们,因为文件太多,我看不到好的文件。这是我正在谈论的图片:

Link for image

我试着把它们全部捆绑起来,但它不起作用。我可以暂存普通文件,但是从node_modules / .bin等它只是站在那里。

我有这个.gitignore文件:

/node_modules/*
/public/hot
/public/storage
/storage/*.key
/vendor
/.idea
/.vscode
/.vagrant
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.env
.phpunit.result.cache
git atom-editor
2个回答
0
投票

您可能已将node_modules /添加到索引中。使用git bash转到该目录,并从索引中删除node_modules目录并提交更改:

git rm --cached -r node_modules
git commit -m "removing node_modules from index"

0
投票

首先在.git / config中设置以下变量:

> [core]
>     autocrlf = false
>     safecrlf = false
>     eol = crlf

然后

然后运行$ git checkout HEAD .

  1. 选择要删除的内容
  2. 右键单击并删除/放弃
© www.soinside.com 2019 - 2024. All rights reserved.