git 我应该在流星 .gitignore 文件中放入什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10728956/
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 should I put in a meteor .gitignore file?
提问by Michael Forrest
I have a new meteor project. I'm guessing the .meteor
dir has a combination of configuration files (needed) and temporary files (not needed).
我有一个新的流星项目。我猜.meteor
目录有配置文件(需要)和临时文件(不需要)的组合。
So what's in your .gitignore
?
那么你的里面有.gitignore
什么?
回答by debergalis
The only directory you want excluded from version control is .meteor/local
.
您希望从版本控制中排除的唯一目录是.meteor/local
.
Meteor automatically creates the right .meteor
and .meteor/.gitignore
, though -- you shouldn't need to do anything.
Meteor 会自动创建正确的.meteor
和.meteor/.gitignore
,但您不需要做任何事情。
回答by Steeve Cannon
You might want to put any configuration settings files in there if you are pushing to a public repos.
如果您要推送到公共存储库,您可能希望将任何配置设置文件放在那里。
I store any security sensitive data configuration settings like encryption keys and various passwords for services like smtp, twitter, facebook and others in a config.js and then put that in .gitignore or in the info/exclude file. Stuff I don't want in a public repo.
我将任何安全敏感数据配置设置(例如 smtp、twitter、facebook 等服务的加密密钥和各种密码)存储在 config.js 中,然后将其放入 .gitignore 或 info/exclude 文件中。我不想要在公共回购中的东西。
Just an additional suggestion to consider for your .gitignore
只是为您的 .gitignore 考虑的额外建议
回答by matb33
Your gitignore should also contain:
您的 gitignore 还应包含:
public/node_modules
公共/节点模块
And you supplement this with a properly crafted package.jsonthat manages node module dependency installation.
你用一个精心制作的 package.json来补充它,它管理节点模块依赖项的安装。
This will necessitate a npm install when installed somewhere new.
当安装在新的地方时,这将需要 npm install 。
回答by Jesse
According to this article, you should ignore your settings.json
, especially if you have environment specific information to include API keys.
根据这篇文章,您应该忽略您的settings.json
,特别是如果您有环境特定信息来包含 API 密钥。
回答by Patrick Mencias-lewis
With meteor 1.3 you want to also ignore node_modules
. There is no reason to have all of the libraries added to git because you can install them through npm. The node_modules
folder most likely is larger than your app (excluding the .meteor/local
folder)
使用meteor 1.3,您还想忽略node_modules
. 没有理由将所有库都添加到 git 中,因为您可以通过 npm 安装它们。该node_modules
文件夹中最有可能比你大的应用程序(不包括.meteor/local
文件夹)
回答by Derek F
Meteor creates a .gitignore
in the .meteor
directory by default.
Meteor默认.gitignore
在.meteor
目录中创建一个。
However, your project's .gitignore
should exclude any sensitive data config files and node_modules
.
但是,您的项目.gitignore
应该排除任何敏感数据配置文件和node_modules
.
回答by monesul haque
if you use
如果你使用
- Intellij IDEignore
.idea
folder - Sublime Textignore
sublime-project
sublime-workspace
- Intellij IDE忽略
.idea
文件夹 - 崇高的文本忽略
sublime-project
sublime-workspace
if you are mac user you can ignore DS_Store
如果你是mac用户可以忽略 DS_Store
and if you use npm ignore npm
cause if both windows and mac user work on same project, as the same npm version is different for mac and windows it shows error.
如果你使用 npm ignore npm
cause 如果 windows 和 mac 用户都在同一个项目上工作,因为相同的 npm 版本对于 mac 和 windows 是不同的,它会显示错误。
回答by Kimmo Hintikka
Here is what I use with Webstorm and Meteor 1.4 deployed with Mupx.
这是我在 Webstorm 和 Meteor 1.4 中使用的与 Mupx 一起部署的内容。
# Meteor files to ignore now handled by .ignore file within .Meteor folder automatically
# settings file to ignore to protect API keys
settings.json
# MUP / MUPX file to ignore to protect server passwords and sensitive info.
mup.json
# npm package files to ignore
node?modules/
npm-debug.log
# Webstorm IDE files to ignore
.idea/*
# Typing type definition files to ignore. Webstorm uses type definitions for autocomplete even without typescript
typings/*
回答by Raphael Arias
We use this gitignore, which englobes many IDEs and Meteor, along system files and others.
我们使用这个 gitignore,它包含许多 IDE 和 Meteor,以及系统文件和其他文件。
### WebStorm ###
.idea/
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows shortcuts
*.lnk
### Linux ###
*~
# KDE directory preferences
.directory
### SublimeText ###
# cache files for sublime text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
# workspace files are user-specific
*.sublime-workspace
# project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using SublimeText
# *.sublime-project
# sftp configuration file
sftp-config.json
### Node/NPM ###
node_modules
npm-debug.log
### Development ###
dump
mochawesome-reports
ngrok
回答by Subotica Dmitar
you will need to put installed packages directory named node_modules which is located in root directory. and while you commit project it will be ignored. also product manager can easily install packages in their server using package.json.
您需要将名为 node_modules 的安装包目录放在根目录中。当您提交项目时,它将被忽略。产品经理也可以使用 package.json 在他们的服务器中轻松安装软件包。