【问题标题】:How do I avoid adding the node_modules to my git working directory? [duplicate]如何避免将 node_modules 添加到我的 git 工作目录? [复制]
【发布时间】:2019-02-04 19:55:33
【问题描述】:

我认为最好不要将 node_modules 添加到 git 存储库,因为有人可以使用 npm 和 package.json 文件安装这些模块。那么如何在没有 node_modules 文件夹的情况下将所有项目文件添加到工作目录?谢谢!

【问题讨论】:

标签: javascript


【解决方案1】:

在仓库的根目录中创建一个 .gitignore 文件,然后在该文件中输入 node_modules。保存它,将其添加到 repo 并提交。

【讨论】:

    猜你喜欢
    • 2017-10-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多