如何从 github(发布分支)中删除节点模块
how to remove node modules from github (release Branch)
目前我在发布分支下工作,当我尝试将我的代码提交到 Git.
时,我遇到了一个问题
我能够在我的 github 桌面上看到所有节点模块都可用 请找到相同的参考。我不想提交这个文件。
这是我的 .gitignore 文件
参考文件夹结构
您似乎需要忽略 node_modules
文件夹。为此,只需将 ui/node_modules/**/*
行添加到 .gitignore
文件即可。
首先,如果这些文件过去已经提交,您需要删除它们(从 Git,而不是从您的磁盘)以便忽略它们:
git rm --cached -r ui/node_modules
其次,甚至在提交之前,您可以检查您的 .gitingore 是否适用于:
git check-ignore -v -- ui/node_modules/aFile
(用实际文件替换 aFile
)
如果它 return 什么也没做,请仔细检查您的 .gitignore
.
的内容
如果该文件直接位于 ui
文件夹中,就在 node_modules
上方,则规则需要是
node_modules/
目前我在发布分支下工作,当我尝试将我的代码提交到 Git.
时,我遇到了一个问题我能够在我的 github 桌面上看到所有节点模块都可用 请找到相同的参考。我不想提交这个文件。
这是我的 .gitignore 文件
参考文件夹结构
您似乎需要忽略 node_modules
文件夹。为此,只需将 ui/node_modules/**/*
行添加到 .gitignore
文件即可。
首先,如果这些文件过去已经提交,您需要删除它们(从 Git,而不是从您的磁盘)以便忽略它们:
git rm --cached -r ui/node_modules
其次,甚至在提交之前,您可以检查您的 .gitingore 是否适用于:
git check-ignore -v -- ui/node_modules/aFile
(用实际文件替换 aFile
)
如果它 return 什么也没做,请仔细检查您的 .gitignore
.
的内容
如果该文件直接位于 ui
文件夹中,就在 node_modules
上方,则规则需要是
node_modules/