Fallenreaper Fallenreaper - 7 months ago 50
Git Question

Should I remove the generated platform/ folder from my tracked code?

For some reason I noticed that someone on my team as committed and pushed the platform directory generated code for the ionic framework / cordova. Since it is generated based on the machine, I think that I should remove it from my source tree and just make sure the packages.json file is updated with whatever platforms/plugins were needed to generate the correct code.

I figure that i should then add platforms/ to my .gitignore file so they dont do it again.


IMO This is the correct way to publish ionic applications to github. However, there is a catch. When you are building the application for native devices, you will likely run into instances when you need to change platform-specific configuration files in the /platforms folder. If you are working with a team and need each member to be able to build the app for deployment, then you will need to ensure their configurations are synced with yours. Usually I only use one machine to do builds for my ionic apps, so this isn't a problem.

Here's a copy of my usual ionic .gitignore: