[英]Git cannot ignore node_modules in Visual Studio
在這種情況下,我的同事已經將node_modules文件夾從他的計算機推送到了遠程倉庫。
在我的機器上,我運行“ npm_install”來安裝所有必需的依賴項。 現在,當Iam嘗試與遠程倉庫進行同步以獲取新更改時。 我收到此消息:
Cannot pull because there are uncommitted changes.
Commit or undo your changes before pulling again. See the Output window for details.
在更改選項卡中:包括我的node_modules目錄。 因此,我需要忽略它。
我嘗試了以下方法:
注意: node_modules目錄位於Repo \\ Comaps \\ Compas_ng \\ Compas_ng文件夾中,該文件夾是解決方案中的Web應用程序。 gitignore文件位於父目錄的Repo \\ Compas目錄中。
但是,當再次同步它時,node_modules仍顯示在更改選項卡中。
我該怎么辦才能解決問題? 以及為什么這些選項對我不起作用。
您需要清理node_modules文件夾的緩存:
git rm --cached -r node_modules
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.