Version control

Hi guys,
What should and shouldn’t I put in version control? In others words: how usually is Meteor apps .gitignore files?
I saw that /.meteor has a .gitignore that just ignores /.meteor/local and read about ignoring setttings.json file too.

There is already a common pattern in the community?
If I clone a Meteor app, it should run just fine? What about Node & Mongo hosts and ports?

Cheers!

1 Like

That’s a bit of a problem, most of the time you cannot run a clone without intervention.
Personnaly, i just commit the “packages” file in my .meteor folder.

My .gitignore file consists of:

local
server/settings.json

I think that’s all you need really.

@sergiotapia, when you clone that repo in another machines, Meteor runs fine? Or you must to do some changes? Thanks.

For repeatable builds, one must definitely commit packages, platforms, release, versions files within the .meteor directory. Otherwise, when cloned, the new copy may have different versions of meteor and packages.

1 Like

Well, just found a solution to my “fear” about environment specific settings:

Really considering Meteor for the next production-grade project.

The .meteor folder already contains a .gitignore file that will do the job. I also have this in my .gitignore in the project folder:

settings.json
.idea

Typically my settings.json will contain private keys, and I wouldn’t want those in a repository I don’t fully control. I put the settings.json file on a secure server that Jenkins will scp from right before building. The .idea folder is for WebStorm.

2 Likes

Yes, we can clone and run things easily with minimal fuss. Everything Meteor needs to run is inside your .meteor folder. The other stuff is your app.

I’d be surprised if someones .gitignore were longer than 5 lines for a Meteor project.

Thanks @sergiotapia, I’ll follow your - and @ffxsam - suggestion to let Meteor do the ignore job, within settings.json + IDE/TextEditor specific folders/files (that is already in global gitignore btw).

My only addition will be a .env/.env.example file to illustrate what should be the environment settings used and expected for the project.

Thank you guys.
Cheers.

EDIT
If using MUP I recommend ignoring mup.json files too, just left a mup.json.example (or something like that) with default settings.