通常通过 .gitignore 排除哪些 Node.JS 特定的文件和文件夹?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8515040/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What Node.JS-specific files and folders are usually excluded via .gitignore?
提问by Aaronontheweb
I'm a newbie Node.JS developer...
我是一个新手 Node.JS 开发人员...
What do developers usually exclude from their Node.JS git repositories in production via .gitignore?
开发人员通常通过 .gitignore 从他们的 Node.JS git 存储库中排除什么?
node_modules? bin? Etc...
节点模块?斌?等等...
回答by seppo0010
GitHub has created a repositoryto answer this kind of questions for several languages/frameworks, including one for NodeJS.
GitHub创建了一个存储库来回答多种语言/框架的此类问题,其中包括 NodeJS。
https://github.com/github/gitignore/blob/master/Node.gitignore
https://github.com/github/gitignore/blob/master/Node.gitignore
Here is the current one for reference :
这是当前的一个供参考:
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
pids
logs
results
build
node_modules
回答by alessioalex
Easiest way to check that out is to look at the most popular Node.js modules on github:
检查这一点的最简单方法是查看 github 上最流行的 Node.js 模块:
https://github.com/visionmedia/express/blob/master/.gitignore
https://github.com/senchalabs/connect/blob/master/.gitignore
https://github.com/nodejitsu/forever/blob/master/.gitignore
https://github.com/LearnBoost/socket.io/blob/master/.gitignore
https://github.com/visionmedia/express/blob/master/.gitignore
https://github.com/senchalabs/connect/blob/master/.gitignore
https://github.com/nodejitsu/forever/blob/ master/.gitignore
https://github.com/LearnBoost/socket.io/blob/master/.gitignore
回答by Ricardo Tomasi
As a start:
作为开始:
.DS_Store
thumbs.db
*.log
node_modules/
Add your config.json, compiled .jsif you're using coffeescript, etc.
如果您使用的是 coffeescript 等config.json,请添加您的, 编译.js。
回答by Victor S.
You can do it on the site gitignore.io.
您可以在网站gitignore.io 上进行。
gitignore.io is a web service designed to help you create .gitignore files for your Git repositories. The site has a graphical and command line method of creating a .gitignore for your operating system, programming language, or IDE.
gitignore.io 是一项网络服务,旨在帮助您为 Git 存储库创建 .gitignore 文件。该站点具有为您的操作系统、编程语言或 IDE 创建 .gitignore 的图形和命令行方法。
Linkto .gitignore only for Node.js.
仅适用于 Node.js 的.gitignore链接。
Video tutorialfor the service.
该服务的视频教程。

