【问题标题】:Creating seed project of mean stack创建平均堆栈的种子项目
【发布时间】:2017-09-18 09:20:51
【问题描述】:

我已经完成了一个项目,我想把这个项目上传到 GitHub,但是这个项目也包括节点模块,我也不想上传它们。我的意思是,从 git 克隆项目并键入“npm install”的人已经可以安装软件包,因此上传所有软件包没有意义。

那么我怎样才能为我的项目创建种子,有没有框架呢?

【问题讨论】:

  • echo 'node_modules' >> .gitignore?

标签: javascript node.js seed


【解决方案1】:

在项目的根文件夹中创建一个.gitignore 文件,并添加您不想上传到 GitHub 的任何内容,例如 node_modules。 git 将忽略添加到此文件中的任何内容。

# inside .gitignore
node_modules

如果 node_modules 已经添加并提交,则必须从 git 中删除该文件夹。否则即使文件夹在.gitignore,也不会被忽略。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-11-29
    • 1970-01-01
    • 1970-01-01
    • 2016-04-22
    • 2016-09-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多