您是否应该将node_modules文件夹提交到Git?

Should you commit the node_modules folder to Git?

您是否应该将node_modules文件夹提交到Git?

I mention Git but the same applies to any version control system you happen to use

我提到了Git,但同样适用于您碰巧使用的任何版本控制系统

That’s a good question to have. There are pros and cons.

这是一个很好的问题。 有优点也有缺点。

I suggest the default is to not commit the node_modules folder, and instead add it to your .gitignore file.

我建议默认为提交node_modules文件夹,而是将其添加到您的.gitignore文件中。

You might have special needs that reverse this decision.

您可能有特殊需求,需要逆转此决定。

I discuss the topic so you can make your own opinion.

我讨论该主题,以便您发表自己的看法。

这是一些赞成不提交node_modules的参数 (Here are some arguments in favor of not committing node_modules)

You keep your Git history clean. When you add a new package, you store the package.json and package-lock.json file changes. When you decide to update the package version, all you store is the package-lock.json file change.

您保持Git的历史记录整洁。 添加新软件包时,将存储package.json

你可能感兴趣的:(java,git,vue,python,大数据,ViewUI)