Minimal files to check into source control

I would like to check in only the required files to git which I believe would be:

config.xml
ionic.project
package.json
bower.json
www/* (except for www/lib)

These files contain all the custom, unique information for a project, but I can’t seem to find the right ionic CLI command to automatically install all my cordova plugins and platforms off of this information. The plugins are listed in package.json so I have to imagine there is a way to do it, but I couldn’t find any information on this.

So, 2 questions:

  1. Are these the right list of files to check in or are others needed?
  2. How does another developer properly install their environment after pulling down these files (i.e. npm install, bower install, then ??)
1 Like

Hey @jeffwhelpley

So the CLI should have some cordova hooks that take care of this.

https://github.com/driftyco/ionic-cli/tree/master/lib/hooks

So any plugins that are added to a project will be referenced in your package.json.

Then after a fresh clone of the project, the hooks will go off a fetch each plugin.

So are you saying I should check in my hooks directory?

If no, then how does someone get the hooks?

If yes, then that makes sense but I would suggest making it so you don’t have to check hooks into source control in the future.

My ideal workflow, fyi, would be something like this:

  1. either git clone blah or git pull origin master
  2. ionic update // will load all hooks, plugins, platforms, etc. from ionic.project file. As an aside, unless there are technical reasons for putting the cordova plugins in package.json, it sort of makes more sense to me being in the ionic.project file.

Thanks for all the help!

You don’t have to check in the hooks directory, because the cli will automatically add that for you if the directory doesn’t exist.

So what the workflow is:

  • Work on project for a bit, add plugins as needed, check into git repo
  • new computer- clone project and add ios/android projects
  • hooks will automatically add the plugins before creating the ios/android project.

The ionic.project is really for our services part, so having the plugins there really doesn’t make sense.

OK, I tested this out and works great. Thanks for the info. Feel free to close.