What should I put in a meteor .gitignore file?

2019-03-08 09:08发布

I have a new meteor project. I'm guessing the .meteor dir has a combination of configuration files (needed) and temporary files (not needed).

So what's in your .gitignore?

15条回答
贼婆χ
2楼-- · 2019-03-08 09:29

Meteor creates a .gitignore in the .meteor directory by default.

However, your project's .gitignore should exclude any sensitive data config files and node_modules.

查看更多
Juvenile、少年°
3楼-- · 2019-03-08 09:31
  1. gitignore is used to ignore all the unnecessary burden over the git server and your fetching all the time.
  2. So the best possible stuff to put inside the gitignore is packagable entity. Now, this includes the meteor downloadable packages, so, you should just add ".meteor/local" inside gitignore.
  3. When you add it to gitignore configuration, it reduces the size of project to n times smaller as it would be with the packages.
  4. If you cut-paste the entire project now to different location or fetch the repository without .meteor/local folder and start the project using meteor command, the meteor first downloads the required packages and then starts the server.
查看更多
狗以群分
4楼-- · 2019-03-08 09:33

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.

Just an additional suggestion to consider for your .gitignore

查看更多
祖国的老花朵
5楼-- · 2019-03-08 09:34

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)

查看更多
甜甜的少女心
6楼-- · 2019-03-08 09:39

The only directory you want excluded from version control is .meteor/local.

Meteor automatically creates the right .meteor and .meteor/.gitignore, though -- you shouldn't need to do anything.

查看更多
爷、活的狠高调
7楼-- · 2019-03-08 09:39

if you use

if you are mac user you can ignore 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.

查看更多
登录 后发表回答