Cordova 5.0.0: Which files should I commit to git?

You can save platform and plugin afterwards by using following commands.

platform mass saving

$ cordova platform save

Plugins mass saving

$ cordova plugin save

Kindly note that there is no -- in above commands

One More thing, after fetching repo on another machine you just run following command to generate and fetch plugins and platforms automatically

$ cordova prepare

For more reference visit the links below. https://cordova.apache.org/docs/en/latest/platform_plugin_versioning_ref/#mass-saving-platforms-on-an-existing-project

Cordova Tip: Always refer to official docs before before anything else to get the right solution.


It depends on the platforms.

You can use this example of .gitignore and customize according to your needs.

# Mac
.DS_Store

# iOS
platforms/ios/build/
platforms/ios/www/
platforms/ios/cordova/console.log
*.xcuserdatad

# android
platforms/android/assets/www
platforms/android/bin
platforms/android/gen
platforms/android/local.properties
platforms/android/ant-build
platforms/android/ant-gen
platforms/android/CordovaLib/ant-build
platforms/android/CordovaLib/ant-gen
platforms/android/CordovaLib/bin
platforms/android/CordovaLib/gen
platforms/android/CordovaLib/local.properties

# wp8
platforms/wp8/bin
platforms/wp8/obj
platforms/wp8/www
platforms/wp8/.staging
platforms/wp8/*.suo
platforms/wp8/*.csproj.user

# res
resources/signing

You can ignore the platforms and plugins directories as long as you haven't added any custom code in them.

When adding plugins and platforms add --save to the command. e.g.

cordova platform add [email protected] --save

or

cordova plugin add cordova-plugin-device --save

This will save a record of the plugins and platforms you use to your config.xml file. When you run cordova prepare or cordova build all of your plugins and platforms listed in config.xml will be installed if they haven't been already.

You can also specify a platform in prepare and build. So if you are on your Mac, you can check out the git repository and run cordova prepare ios to install just the ios platform and plugins.


I don't know the answer, but I've found something that might help. This pull request was approved.

Here's the file :

# Mac
.DS_Store

# Node
npm-debug.log
/node_modules

# Cordova
/platforms
/plugins

# res
resources/signing