155

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?

Psychonaut
  • 859
  • 8
  • 22
Michael Forrest
  • 3,461
  • 4
  • 22
  • 35

15 Answers15

209

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.

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
debergalis
  • 11,870
  • 2
  • 49
  • 43
  • 5
    Is this still the case? because this I started a project this afternoon and there was no .gitignore to be found. – akst Nov 12 '14 at 15:21
  • 17
    Heh. Now I get it. It's not inside projects root but is inside .meteor folder. – Nek Nov 29 '14 at 20:43
  • I ignore the whole .meteor dir without the 'packages' file and I had no problems for now moving the project around different environments. – thinklinux Apr 07 '15 at 22:04
  • 11
    This answer is not correct. You should ignore your `settings.json` if you're using it to store API keys. – Jesse Apr 22 '15 at 13:49
  • 1
    @Jessee is right -- this isn't something you'd want to even defer. The answer details should cover this; if you're going to store sensitive information in your meteor package you should .gitignore it – lol Oct 22 '15 at 13:19
22

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

Steeve Cannon
  • 3,682
  • 3
  • 36
  • 49
  • 4
    You shouldn't ignore this answer since the accepted answer won't prevent you from publishing your social media and AWS tokens in your `settings.json`. – Jesse Apr 22 '15 at 13:47
11

Your gitignore should also contain:

public/node_modules

And you supplement this with a properly crafted package.json that manages node module dependency installation.

This will necessitate a npm install when installed somewhere new.

matb33
  • 2,820
  • 1
  • 19
  • 28
7

According to this article, you should ignore your settings.json, especially if you have environment specific information to include API keys.

Jesse
  • 2,043
  • 9
  • 28
  • 45
7

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

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.

Derek
  • 655
  • 1
  • 8
  • 9
  • If you exclude node_modules, you must include any subdirectories in the package.json "dependencies" section. Otherwise it could cook your deploy. – Deborah Jun 18 '16 at 07:14
3

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.

monesul haque
  • 351
  • 1
  • 11
3

Here is what I use with Webstorm and Meteor 1.4 deployed with 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/*
Kimmo Hintikka
  • 13,472
  • 7
  • 34
  • 63
3

We use this gitignore, which englobes many IDEs and Meteor, along system files and others.

### 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
2

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.

2
### MeteorJS ###
# default meteor build and local packages
.meteor/local

# meteor settings file
settings.json

# meteor build output files
*.tar.gz

# general swp files from vim
*.swp

# End of https://www.gitignore.io/api/meteorjs
2

you can use this site https://www.gitignore.io/ to generate a .gitignore file for any project , just insert the thechnologies you use and your IDE

Ilyes Atoui
  • 474
  • 2
  • 9
  • 29
1

This is the .gitignore file I use with Intellij:

  node_modules/
  .meteor/local/*
  .idea/
  npm-debug.log
  packages/*/.npm/
husayt
  • 14,553
  • 8
  • 53
  • 81
0
  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.
Ankur Soni
  • 5,725
  • 5
  • 50
  • 81
0

.meteor/local is the only thing you want missing from version control.

Meteor automatically generates a .gitignore file that would fit your needs.

If it's a public repository you'll likely want to include "settings-development.json" or any other JSON files containing information you don't want to disclose to the public such as AWS API keys.

However Bitbucket and some others provides free private repositories which should fit your needs.