You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Git-ignore未忽略node_modules,GitHub Desktop仍提示推送更改

解决方法

先看你的文件夹结构:
我的文件夹结构

按以下步骤操作即可解决:

  • 打开项目所在的终端,执行命令移除Git对node_modules的追踪(不会删除本地文件):
    git rm -r --cached node_modules
  • 提交这个更改:
    git commit -m "不再追踪node_modules文件夹"
  • 把这个提交推送到远程仓库

完成后,GitHub Desktop就不会再提示node_modules的更改了。

内容的提问来源于stack exchange,提问作者Mahmudul Ahsan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.27 12:42:01